I need to restrict option to resolving tickets with specific label to few people. Is it possible?
I know there is an option to restrict via project settings->permissions->"resolve issue" and restrict to specific roles or groups but I need this only for ticket with specific label. it is not possible in that way. Do you have any suggestion?
Hi @Kinga Kubijk ,
As everyone already stated, this is absolutely possible. I'll give you one more option using Jira Expressions, an easy-to-learn language that is behind pretty much all custom conditions/validators in Jira Cloud.
You'll want something like this:
user.groups.filter(g => g == "administrators").length > 0 || issue.labels.filter(h => h == "label1").length >0
This expression has two parts, the first one checks if the current user is in the group "administrators", if so: Great, the condition passes. If not, the second part checks for the presence of "label1" in labels. If it's there: Great, the condition passes. If not, well then no transition for you.
You can of course build much more complex conditions with Jira Expressions, but this should give you an indication of what's possible.
Now, how to add a custom condition into your workflow? As @Nic Brough -Adaptavist- said, you'll need an app for that. Personally, I like Cloud Workflows, but that's because I was heavily involved in its creation. I believe virtually all Workflow apps for Jira Cloud now support Jira Expressions, so no matter which one you choose, the above should work for you.
Hope that helps,
Oliver
Use a condition or validator that basically says "if label = xyz, then return false"
A condition will hide the option to transition the issue
A validator will let the user trigger the transition, but then take them back to where they were before with an error message (which you can set if you're using certain types of validator)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How I can set up "IF" in conditions or validators to not block the option to close ticket if this one specific label is not applied. I do not see "if" option.
I have two scenarios:
1) tickets with "label1" -> everyone should be able to resolve ticket with out any conditions.
2) tickets with "label2" -> only administrators should be able to resolve ticket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You'll need one of the scripting or advanced workflow function apps to do that specifically, but the way Jira does conditions is by grouping the checks together in blocks, so you can do things like
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.
probably a couple ways to handle this, but you could always put the specific users in a group. Then add a condition or validation on the transition to your resolution status to only allow that group to transition if label/s contains xyz.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can add a condition Value Field to your transition in the workflow of that issue type. Additionally, you add a User Is In ... condition to limit it to a few people.
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.