Hello all!
Sorry, this is the first time I try to create my own custom listener with Script Runner Listeners. And I don't know a lot of groovy, so I maybe tell some enormous mistakes...
My use case is:
When a ticket is updated, I want to check if a field A value was changed during this update, and maybe to edit this ticket
The A field could be system field (description) or custom field, it depends.
I have many problems doing that:
1. The "IssueEvent" object doesn't have the Issue BEFORE the update and the Issue AFTER the update (but why...
), so I try to find what was changed during this update. But when i have a look on event.toString(), i just see that:
changelog=[GenericEntity:ChangeGroup][issue,17543][author,c_droobi][created,2019-04-21 18:24:28.473][id,80599],eventTypeId=2,sendMail=true,params={eventsource=action, baseurl=https://tst-jira.myjira.com},subtasksUpdated=true]
There is nothing!
I saw on different other topics solutions like this (for example in https://community.atlassian.com/t5/Marketplace-Apps-questions/Find-out-if-a-JIRA-update-event-changes-a-specific-issue-field/qaq-p/618091):
def change = event?.getChangeLog()?.getRelated("ChildChangeItem")?.find {it.field == "SelectListA"}but I can't find anything, my "change" variable is empty...
2. When i try to change the value of one of my fields, for example "description field", i see that the Issue object has no setter... I can see with the help of Google I should have a "mutable Issue" object, but I don't find how to transform my original Issue on mutable issue to work with...
Could you please help me to go further on this issue?
Thank you very much. Appreciate!