How to use the same workflow but have different resolutions between projects

p.noack@samsung.com August 4, 2017

I have a workflow that many projects user.  I like to re-use workflows.  I brought on a new project and the only minor change that this project needs is for the resolution values to be different.  Currently I control what resolutions a project will see through the resolve transition property jira.field.resolution.include

This particular workflow lists 4 resolutions.  The new project I am creating only needs 3 of those 4 resolutions.

I was wondering if there was some means of doing a post function that would either strip out that 4th resolution type or if it could list the resolution types for that one project.

I have done something before on a shared workflow in the create transition with ScriptRunner workflow function - Custom script post-function  that checked what project it was.  if it was a specific project there was a list of users that needed to be added as watcher at creation.  

Is there some means of doing this for the resolution field in the resolve transition?  I realize it is two different things.

Thanks for any advice you have. 

2 answers

1 accepted

0 votes
Answer accepted
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.
August 4, 2017

Not without a bit of code, because it's the same workflow.

What you could do is have two transitions that do the same thing, but

1) Have a condition on one saying "if project 1, allow this transtion", and another saying "if project 2, allow this transition"

2) Use different jira.field.resolution.include(s) on the transitions

p.noack@samsung.com August 4, 2017

That seemed like a totally evil thing to do but now that I implemented your suggestion it is pretty slick.  I just needed to make sure the name of my transition was evident that it was moving the issue to resolved.

Excellent suggestion!  Thank you for your help!

0 votes
Steven F Behnke
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.
August 5, 2017

If you have Adaptavist Scriptrunner for JIRA Server, you can use a Behavior to accomplish this with very little coding. 

This article on the documentation covers the exact scenario: https://scriptrunner.adaptavist.com/latest/jira/recipes/behaviours/restricting-priority-and-resolution.html

(Nic why am I always plugging service desk on your posts ;0 )

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.
August 6, 2017

Scriptrunner is a good solution for a lot of things :-)  That's why Adaptavist chased Jamie for so long!

Suggest an answer

Log in or Sign up to answer