Full name for user picker custom field

Issue #462 resolved
Christian Schlaefcke created an issue

Hi Fidel,

we are using the Send an email post function and wonder if it would be possible to resolve the full names of users selected in a multi or single select user picker custom field like for the system user fields (e.g. assignee, reporter)?

Kind Regards,

Christian

Comments (9)

  1. Fidel Castro Armario repo owner

    Hi Christian,

    Yes, it can be done by previously using "Copy a parsed text to a field" post-function in order to store into an ephemeral string field the full names of the desired User Picker or Multi-User Picker custom field. Then you will be able to use the ephemeral string field in "Send an email" post-function.

    This is an example:

    Captura de pantalla 2016-12-12 a las 20.05.24.png

    Text to be parsed is:

    • For User Picker custom fields:
    userFullName(%{nnnnn})
    
    • For Multi-User Picker custom fields:
    toString(textOnStringList(toStringList(%{nnnnn}), userFullName(^%)))
    

    replacing nnnnn with field code for User Picker or Multi-User Picker custom field.

    If you are using personalized sending mode in "Send an email" post-function, you should use "Ephemeral string 1" or Ephemeral string 2", since the rest of ephemeral string fields are overwritten.

  2. Christian Schlaefcke reporter

    This works almost perfect - Thank you!

    One further question regarding the output of the Multi-User Picker. When we have multiple persons selected - e.g. Tom Miller and Mike Thompson the output would be: Output: Miller, Tom, Thompson, Mike

    Would it be possible to tweak this to use another separator (e.g. ";" or "/")? Fancy would be if it we can put the result in a bullig list...

  3. Christian Schlaefcke reporter

    And one other thing came up as well, but this might be a new issue if you like: Is it possible to render wiki text from the issues description in the body of the mail sent by the Send an email post-function?

  4. Fidel Castro Armario repo owner

    Do you want to create an html list using <ul> <li> tags?

    Converting wiki to html might be possible, but very difficult to implement using text format functions. I will study the feasibility of adding a special format function to do it.

  5. Christian Schlaefcke reporter

    yes - <ul> <li> would be great!

    Thank you for investigating the wiki to html rendering!

  6. Fidel Castro Armario repo owner

    In order to get a <ul><li> html list from a Multi-User Picker custom field, use "Copy a parsed text to a field" post-function in advanced parsing mode with the following text expression:

    "<ul>" + replaceAll(toString(textOnStringList(toStringList(%{nnnnn}), "<li>" + userFullName(^%) + "</li>")), ">,", ">") + "</ul>"
    

    replacing nnnnn with field code for the Multi-User Picker field.

  7. Chau

    Hi Fidel, I have the same need as Christain's question above and it doens't seem to work. So I use MutilUser field and I want to display the name of the user as the HTML body of the email.

    In HTML body, I try: toString(textOnStringList(toStringList(%{11903}), userFullName(^%))) I also try: "%{11903}, and it gives out user's logon ID: cn10291, gd12312 I'm looking for user display name, like: Chris Nor, Gary Dan.

  8. Log in to comment