Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JMWE Groovy Script to change to another workflow

nwr-fl December 22, 2020

I am running a ServiceDesk (Server) with different workflows, security levels and issue-types. I am trying to define a transition to change four things at the time:

* Assignee
* SecurityLevel
* Issue-Type
* From one Workflow to another

To do this I am trying to write a JMWE Groovy Script. With Assignee and SecurityLevel I have no problem with the script.

Currently I use "Set field value (JMWE add-on)" to change the IssueType in a seperate post function.

My target is to set the new IssueType and change to the correct workflow also using my JMWE Groovy script (I do not have ScriptRunner and I cannot buy it).

All information I found by now is that this is something that should be done very carefully. I could not find any code-sniplets that could be helpful.

Using MOVE is not a solutuion in my case because the IssueSecurity will not change and the issue will not be seen by the new assignee. We have many problems with that.

I hope you can help me...please... as a christmas gift ;-)

 

1 answer

0 votes
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.
December 23, 2020

This is the sort of thing that stops me giving recommendations for scripting and automation apps.  Whilst they're powerful and flexible, they can give you "enough rope to hang yourself with", and frankly, the more powerful ones hand you the keys to a rope factory as well.

Do not use JMWE to change the issue type.  Unless you can guarantee that the source and target issue type have the same configurations, you will break things, probably leaving your data in an unusable mess.  Your issue types must be set up to use the same workflow, the same field configuration, the same security scheme and all the same custom field contexts. 

By same, I really do mean the same schemes.  Not just schemes that are identical, it has to be the same schemes.

If you cannot guarantee those four things are the same, then you must use the "move" functionality.  "Using move is not a solution" is utterly wrong, it is the only way to do it.  There's two options there though - write all the code to emulate what Jira's move code does, or use Jira's move functions.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.6.1
TAGS
AUG Leaders

Atlassian Community Events