Hi All,
Using Jira Service Management Data Center here. I am struggling to find a way to synchronize Insight object attribute(s) with Jira Custom Fields in connected tickets. Here is the case:
- I have Insight Object Schema with 1 Object type with several attributes (for example Phone).
- For each object I have a ticket in Jira (created automatically when the object is created by Insight automation).
- For several of the attributes in the object (for example Phone) I have matching custom fields in the Jira ticket which are copied over when the ticket is created.
Now I need to be able to update the Jira custom field in the connected ticket when someone changes the value of an attribute in the object. I was thinking Insight automation can help, as it can trigger on object update, but I cannot figure out how this can happen. The Jira Automation (for Data Center) does not seem to have any trigger for Insight object updates, so it does not look like useful option too.
Has anyone made such update working before?
Thanks,
Boyan
Edited
OK, almost a year later let me answer to myself. The answer to my question is in the Assets Automation rules, where you can setup a rule to run when an asset is updated and run a Groovy script. In the Groovy script you can describe which attributes you want to copy over to the connected ticket and do it, but pay attention to the type of the attribute/custom field, as the data might need some massaging before you can set the issue field correctly, for example if you want to copy a Date field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Boyan,
Would you be able to share the groovy script you used to accomplish this task? I would like to create an automation that updates Jira issue Date fields based off of the Date attribute within an object tied that Jira issue in an Assets Object Field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the script:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you, Boyan! That worked like a charm. The only issue I ran into was when selecting the date attribute within the object itself it appears that it updates the date field inside the Jira issue to the date prior to the one selected.
I thought that this could have been due to the date time format
def CF_DATE_TIME_PATTERN = "E MMM d HH:mm:ss zzz yyyy"
def CF_DATE_TIME_PATTERN_SIMPLE = "yyyy-MM-dd HH:mm:ss.SSS"
Whereas the date format for the attribute and field dates is dd/MMM/yy (10/Oct/24)
Oddly enough the new and old dates in the assets Activity --> History changelog shows the date prior to the one selected as well... Not sure what is going on there.
Will have to look into that furtherYou must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good to hear that worked. For some reason I do not have this problem with the dates, maybe it is the date format...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.