Script Listener - Moved event

Rathna April 19, 2018

Hi,

I would like to know how the below-given scenario would work:

 

A script listener is configured to be executed when move event is triggered and only in Project A and Project B.

So with that said how does Scriptrunner identify which event is a move event from one project to another vs a move event from one issue-type to another in the same project.

 

Thanks in advance.

1 answer

0 votes
JohnsonHoward
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.
April 19, 2018

Hi Rathan,

 

I am not entirely sure what you are asking here but hopefully some of the below will help answer.

When a move event is triggered it will trigger an IssueEvent. This contains methods such as getChangeLog() and getEventTypeId() (see: IsssueEvent Docs).
With these methods it is possible to determine which event has been triggered and what processes the issue has been through including origin and destination states, the last would be the 'Moved' event. 

If you are wondering what would happen if you moved an issue from a project that is not project A or project B into project A or project B then the event will still be triggered. This is the case for if you use the Project Key parameters or the Conditions parameter of a Script Listener. 

If this does not answer your question then perhaps you could tell me what it is you are trying to do/avoid so I may gain a better understanding.

Thanks
Johnson

Rathna April 20, 2018

Hi John,

 

I guess I did not make my question clear my apologies. What would happen in the below-described scenario?

In Scriptrunner (JIRA) if a listener is configured for Project A and Project B to listen on Issue Moved event. Would the custom listener script execute when a user uses bulk move operation to change the issuetype with in the same project or would it execute when a user uses bulk move to move an issue from Project A to Project B?

Thanks,

Rathna

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 21, 2018

The "move" event is not project specific, but does contain the information on what has changed.

  • If you set up a listener without any rules on when it executes, it will run for every event.
  • If you set it up to only listen for "move" events, it will run for all moves, whether the project changes or not.
  • If you set it up for "move in project A", it will pick up issues moved from A to B, and issues where the move is from A to A and the issue type changes. 

In your follow-up question, you ask about "bulk move changing type" and "bulk move to project B".  The answer is "it will run for both, because they are both move events from project A"

In every case, the event will contain a list of what has changed (project and/or issue type), so your listener code can work out what has been done quite easily.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events