Restrict the issue transition based on the custom field option selected.

venkat muppavarapu September 25, 2023

Hello,

Is there a possibility to restrict the issue transition based on the custom field option selected.

Here is my Scenario:

I have a custom field X (Select list Single choice) with drop down values 1,2,3.

When a ticket is created and has option 1 selected, only a specific user can move that ticket to Done.

I have tried using the user condition in the workflow for the done status

issue.get("customFieldId=XXXXX")=="option 1"

This is hiding the "Done" status option in the workflow dropdown to other users but Its also hiding it for option 2 and 3 as well. I am looking to restrict if only option 1 is selected

 

Any suggestions or solutions to achieve this, please let me know

 

Thanks

2 answers

0 votes
Somesh Sahoo
Contributor
May 14, 2024

This video will help you put field restrictions in workflow transition 


Jira Transition Restriction (field level)
https://youtu.be/W3vhZJkJ52A

0 votes
Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2023

@venkat muppavarapu

 

You need to build out the proper condition flow.

Jira allows you to build a tree where you can build nested conditions:

 

Screen Shot 2023-09-25 at 10.15.24 AM.png

 

In the screenshot I've shared, the conditions will allow either the reporter, or a user that is a part of BOTH of the groups specified to execute the transition.

 

In your case, you'd want it set such that IF the customfield = option 1, then the user must also be a certain person OR the custom field is set to 2/3. 

 

Does that make sense?

venkat muppavarapu September 25, 2023

Hi @Kian Stack Mumo Systems 

Not exactly, how do I build a nested condition? Is it through the workflow conditions?

Should I add the user to a group. I have tried using the below condition and in the condition to the user section, I have used 

issue.get("customFieldId=XXXXX")=="option 1"

condition.PNG

condition 1.PNG

Kian Stack Mumo Systems
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2023

So in this case, you can create just two conditions.

 

The one you are currently creating, and then a second one where custom field = 2/3.

When you have created both conditions, just change the "All of the following conditions" to "Any of the following conditions".

 

Screen Shot 2023-09-25 at 10.45.29 AM.png

venkat muppavarapu September 25, 2023

Hi @Kian Stack Mumo Systems 

I have tried the above option as well and its still hiding the done option for the other custom field options selected as well. I wanted it to be restricted only when option 1 is selected.

I have tried using the user validator from the workflow and used a conditional validator which then worked for me.

 

Thanks for the prompt response and suggestions on this request.

 

Thank you

Suggest an answer

Log in or Sign up to answer