1
0
-1

We want to check with you if there is a possibility to concatinate value of 2 fields from Servicenow like: Questionaire and Description in to on 1 field Of jira i.e Description ?

    CommentAdd your comment...

    2 answers

    1.  
      2
      1
      0

      Hi Anshuman,


      Yes as long as both values are Strings then you'll be able to concatenate them just fine to the Jira description. For example:


      Outgoing Sync ServiceNow:

      replica.questionaire = incident.questionaire
      replica.description = incident.description



      Incoming Sync Jira:

      issue.description = "Questionaire: " + replica.questionaire + " ServiceNow Description: " + replica.description 


      This would concatenate the values of the two remote fields to with a bit of formatting into the description field in the destination Jira ticket.


      Thanks,


      André

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Andre, 


        Thanks for the details, I tried these scripts and it works fine. I have few questions below:


        Can we ignore the null values in any of these fields ? For Ex:

        Check if Questionnaire field in SNOW has value ? then sync it, else sync only description field value through sync.

        1. André Leroy-Beaulieu Castro

          Hey Anshuman,


          Sure that should be possible, are you using exactly the scripts I sent in the last answer? You could use some "if" statements to check if one or both of the incoming fields are null and format the destination description according to that, for example:


          if (replica.questionaire == null) {
          	issue.description = "ServiceNow Description: " + replica.description 
          } else if (replica.description == null) {
          	issue.description = "Questionaire: " + replica.questionaire
          }


          you can adapt this depending on your exact use case.


          Thanks,


          André


        CommentAdd your comment...