I am trying to figure out a way of getting the Change History information from a Jira ticket put into the ServiceNow comments. I did find the How to Sync Change History to the Text Custom Field page but it doesn’t seem to work with ServiceNow. I also asked Copilot to see if they could give me the code and it gave me the following:
But it throws the following error “No such property: field for class: com.exalate.basic.domain.hubobject.v1.BasicHubChangeHistory Possible solutions: id”
I can’t seem to find any information on how to do this sadly. Any help would be much appreciated.
Hi there,
You cannot add a string value directly to entity.comments since this is a list of custom objects expecting comments.
If you want to add a comment, you refer to: addComment
You can pass the string value to this method, and it will create a comment.
Kind regards,
Ariel
Thank you so much for getting back to me again. This sent me down the right path to getting the solution that I was looking for. Adding this to my script gave me all the history every time there was an update which made for a lot of spam quite quickly. In the end I just grabbed the first line of the History and made a comment of that. Also I needed to stop it syncing back and filling up the comments in JIRA too. My final script was: