Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Identify move issue event with a Scriptrunner cloud listener

Cédric Cox
Contributor
October 17, 2020

Hi everyone,

 

I need to change the value of a custom field when an issue is moved from one project to another or from one parent to another. For this, I plan to use a scriptrunner listener ( cloud version). However, the only listener that can relate to this is the issue updated one. How can I be sure that the script is triggered only for a move process and not for any other update? And how can I be sure to access the detail of the updated issue and not its previous properties?

 

Thanks,

 

Cédric

2 answers

0 votes
Ravi Sagar _Sparxsys_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2020

Hi @Cédric Cox 

What about if you still use the Issue Created event and in your code look for the history by expanding the changelog.

/rest/api/3/issue/ESD-20?expand=changelog

 If the issue is created by moving then it will have this entry.

 {
"field": "Key",
"fieldtype": "jira",
"from": null,
"fromString": "ISD-17",
"to": null,
"toString": "ESD-20"
}

I hope it helps.

Ravi

Cédric Cox
Contributor
October 18, 2020

Thanks Ravi. But I finaly tried Jira automation to perform this.

 

However, this is not working:

automation test.jpgI try to copy the parent key into a custom field. The action results in a success according to the audit log, but the field remains empty. That's puzzling.

 

Any help with this?

0 votes
Arthur Mack
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2020

@Cédric Cox 

 

Have you looked at JIRA automation? It has lots of triggers including "Issue Moved"

Cédric Cox
Contributor
October 17, 2020

No. I will if I find no other solution. I already use scriptrunner for other things and I wouldn't like to install another addon.

Arthur Mack
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 17, 2020

@Cédric Cox  It used to be an addon but now its part of JIRA.

 

 

Art

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events