1
0
-1

From ServiceNow, I get the assignment group from the display value.


If a group is selected in ServiceNow that does not exist in Jira then a default value should be set.
In Jira a select list field is used.
Attached my incoming rule but this does not work


incomcing line in jira

issue.customFields."Assignment Group"?.value = replica.assignment_group.display_value :? IBM-other



    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      You can always get an option from a select list using nodeHelper.getOption just like this:

      def group = nodeHelper.getOption(issue, "Assignment Group", replica.assignment_group.display_value)
      if(group != null) {
        issue.customFields."Assignment Group" = group} else {    issue.customFields."Assignment Group"?.value = "IBM-other"}

      or using ternary operator

      def group = nodeHelper.getOption(issue, "Assignment Group", replica.assignment_group.display_value)
      issue.customFields."Assignment Group".value = (group != null) ? group.value : "IBM-other"


      You can modify this sample to your needs. Check here for more details on nodeHelper.getOption


        CommentAdd your comment...