Hello,
i want to change the issue type via a postfunction during a transition.
It seems to be possible with the JMWE postfunction "Set field value". In the configuration of the postfunction i can set the the new value to the new issue type.
While testing, the postfunction is working correctly. The Issue Type is changing from "Incident" to "Task".
Unfortunatly, all the Transitions in the workflow seems to be crashed. There are no Transition-Buttons available in the Issue. Obviously there is something going wrong while transforming the workflow.
Does anybody has any ideas?
Thank you for your help
Hi @Florian,
You should give a second thought, if this is your use case.
JIRA allows defining configurations at issue type level, which makes JIRA so flexible and scalable.
Reason for abnormal behaviour - As you have changed the issue type, the workflow associated with the new issue type would come into effect and hence the new transitions and statuses pertaining to the new workflow would be shown. In fact, if there had been a broken validation, JIRA would not have allowed you to change the issue type.
Hope this addresses your concern.
If you feel that this is useful then please accept my answer, which would motivate us take up more community questions.
Regards,
Ravi Varma
Issue type is not really a simple "field". It's a structural property of an issue, off which hangs a load of configuration data.
My guess is that you have different workflows for Incident and Task - these hang off the issue type. So if you just change the issue type without doing all the workflow migration, they will fail, badly.
You should not use this post-function to change the issue type, unless ALL the configuration for the source and target issue types are shared (not even identical, they have to be shared)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Florian,
unfortunately, setting the Issue Type field only works if both source and destination issue types share the same workflow. Otherwise, Jira gets confused.
What you'd need is a "Move Issue" post-function but it's not that simple, as there are many steps involved in moving an issue (see what happens when you use the "Move issue" operation in the UI). And unfortunately there is no "Issue Move" Manager or Service in the Jira API that you could easily use in a Groovy post-function either.
You can Google "jira scriptrunner move issue" for code examples (ScriptRunner code snippets will usually work as is in JMWE, although they can be simplified using JMWE's simplified API) but it looks like none works satisfactorily.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ok, thank you guys for your immediate support. All your answers were really helpful, even though not what i hoped for :)
@Nic Brough -Adaptavist- you mentioned that the workflows of both issue types not only have to be same, rather they have to share one workflow.
I just copied the workflow of "Incident" and allocate it to the Issue Type "Task". Obviously it is working. All the transitions are usable.
What are the "consequences" you mentioned above?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
True, this will work. A direct copy should be ok. But workflows are often not the same even if they look the same, and more importantly, often drift - you can only be 100% sure that they are compatible if you know you are the admin who copied it and the only one who might edit it (and won't because you know of this issue), or the workflow is shared.
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.