It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can you make it so that validators are only applied for certain issue types?

I had a search but couldn't find anything like, appologies if it is a dupe!

So the scenario is that we're looking to implement Greenhopper and one of the questions that has come up is this:

We have some validators on our JIRA workflow for Bugs that we'd quite like to keep when we're using Greenhopper. My understanding is that if you apply a transition to a workflow step then it applies to ALL issue types that go through the workflow. Is that correct? And is there any way saying that you only want those validators to be applied to certain issue types?

An example would be that we have mandatory comments when resolving bugs so that devs are forced to put a comment in explaining what they did, but we wouldn't need/want that for Stories/Epics/Dev Tasks because we feel it isn't relevent.

2 answers

1 accepted

2 votes
Answer accepted

Three options

1. Define different workflows for the different issue types (bug workflow has the validators, story workflow has different ones)

2. Write new validators that include "if issue type = X, then <rest of validator>" code

Thanks Nic - couple more questions on those solutions if you don't mind?

With regard to the differnt workflows

  • I'm assuming that you have house these different workflow routes in one overall workflow, which is applied to the project?
  • If that is the case, I can't see where you can specify how you'd state that certain validators would apply to certain issue types.
  • If that isn't the case, I haven't worked out how you can apply multiple workflows to a single project - is there any documentation around for that?

And as for the writing of new validators

  • Would that be at a script level?

Thanks in advance.

No, I think you've missed the point.

1. No, as I said, You have different workflows for different issues.

2. No, as I said, different workflows can have different sets of validators (and conditions, status, transitions, post functions etc)

3. Create a workflow called Bug-wf. Create another workflow called Issue-wf. Use different validators in them. Create a new workflow-scheme. When you go into that, you can edit which workflow is used for issue types (e.g. use your Issue-wf for "Issue" and then Bug-wf for "Bug", and maybe set the default to the default workflow). Associate that workflow-scheme with your project

For new validators:

Traditionally, you write them as plugins. If you have the script runner plugin, that saves you having to construct your own plugin, and simplifies it a lot.

ahhhh now I see where you're coming from and I understand :) That is definitely where I got confused - I didn't realise you could have multiple workflows inside a workflow scheme. And of course it seems bleeding obvious once someone says it to you because it's how the rest of JIRA works as well! Appreciate it Nic, this should do the trick!

As far as I know, as long as you don't use the Greenhopper simplified workflow and you have your issues tied to a workflow you had defined previously, Greenhopper "respects" that workflow meaning that validators, post-functions etc. will stay valid...

Thanks Christian - that's what I thought but at the moment I think all the validators are applied globally to all issue types as JIRA is only used for bug tracking currently (we use Pivotal Tracker for project management and want to move from that to Greenhopper).

Same question to you as I have asked Nic - how do you apply a validator to affect a specific issue type?

Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you