The Exalate team will be on holiday for the coming days - returning Jan 4
Enjoy & stay safe
Morning, I am trying to push the display value of the "assignee" in Jira to a String field in Servicenow. I have tried to do the simple mapping, but all that did was to display the key.
replica.assignee = issue.assignee
entity.u_assigned_to_in_jira = replica.assignee
I have then found a community post from Francis that advises the following code (which I have updated for my instance)
entity.u_assigned_to_in_jira = nodeHelper.getUserByEmail(replica.assignee?.email)?.key
But this only populates the sys_id of the user in the field, rather than the name.
Ideally I would like just the simple display value pushing from Jira, as we may have the situation that some Jira users are not listed in ServiceNow, so the 2nd solution would not work
Thanks for your reply, I had actually tried that and it did not work. Francis actually resolved the issue by using the following:-
entity.u_assigned_to_in_jira = replica.assignee?.displayName
Notice it has the "?" just after assignee
In this case where you only want the displayName of the Jira assignee to show as text in the u_assigned_to_in_jira field, you don’t need to use the helper method “nodeHelper.getUserByEmail” because you don’t need to find a local user, you just want the displayName of the remote user as text, so the following line should suffice for this use case:
entity.u_assigned_to_in_jira = replica.assignee.displayName
© 2019 Exalate. All rights reserved.