xl8bot
November 4, 2024, 7:08am
1
Originally asked by Anshuman Bakshi on 02 February 2021 (original question)
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 ?
xl8bot
November 4, 2024, 7:08am
2
Answer by André Leroy-Beaulieu Castro on 02 February 2021
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é
xl8bot
November 4, 2024, 7:08am
3
Answer by Anshuman Bakshi on 08 February 2021
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.
Comments:
André Leroy-Beaulieu Castro commented on 08 February 2021
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é