Post function to change issue type

Artur Mkrtychian May 31, 2017

Hi,

 

I use different workflows on the project. After one workflow is finished, I want the issue pass through other workflow. Right now, I can only manually change issue "Move issue" to change issue type. I want to add post functions to change issue type.

Similar problem:

https://community.atlassian.com/t5/JIRA-questions/Can-I-migrate-issues-between-workflows-under-a-single-project/qaq-p/155461

1 answer

1 vote
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.
May 31, 2017

This is a very poor design, or at least data and process mapping into JIRA. 

Your workflows should match your process.  You don't have two processes here, you have one, so you should really have one workflow to match it.  Also, generally, issue types are not something that should change as part of the process.  Bugs don't suddenly become Epics just because you've got to a certain point in the process.

On the practical side, yes, you can change the issue type, but it's not going to be pretty.  I would not try to do it as a post-function, as the issue type is structural, and you could potentially be changing the structure from inside it.  Your idea means the issue will have two workflows.  The post-function changing the issue type will be changing from one workflow to another while executing part of the current workflow.  That is going to make a mess - you're effectively removing the current process partway through itself.

This should be done as a listener, which will pick up the last event and change the issue type after the transition is complete.  Otherwise you'll have to deal with transient data changing during the process.

Second problem is that your code is going to have to replicate what "move" does - checking all the data to ensure it is valid in the new configuration for the target issue type.

Suggest an answer

Log in or Sign up to answer