Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

how to restrict Custom field values

Sreenatha Reddy J
Contributor
July 11, 2022

I have custom field called Priority Number and it has multiple priorities like 1,2,3,4,5......, now I just wanted to restrict the values. ex. when user is creating issue he selected as priority 1 and if its resolved then only another user can create the issue with priority 1, if issue is not resolved then it should give the error message like Already priority 1 used once that is resolved then you can create issue with priority 1 or else please select next priority.

 

We are using cloud Jira.

 

3 answers

1 accepted

0 votes
Answer accepted
Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 15, 2022

Hello @Sreenatha Reddy J

Thank you for reaching out.

I'm afraid Jira does not have an inbuilt way to prevent a field to be added with a value if that same value is filled in the same field of another open issue, however, you can use Automation for Jira to achieve something similar:

  1. Add a comment to the issue informing that another issue is already created with priority 1
  2. Downgrade the issue priority to another value after the ticket is created

These would be the steps to achieve the scenario above:

  1. navigate to your project > Project settings > Automation
  2. Click to create a new rule. If the rule should apply to multiple projects, click on Global administration > Create rule.
  3. Create an automation rule similar to the following one:
    Screen Shot 2022-07-15 at 11.51.30.png

The logic behind that automation rule would be:

  1. Trigger: The rule is triggered when the Priority_Number field is updated
  2. IF: Check if the value "1" was added to the Priority_Number in the issue that triggered the rule
  3. IF: Run a JQL checking if there are any other open issues with the value "1" added to the Priority_Number, ignoring the one you just created (Count 1)
  4. If both "IFs" are true:
    1. Action: Add a comment to the issue, informing the downgrade
    2. Action: Downgrade the Priority_Number to 2, or any other values you want

Let us know if you have any questions.

Sreenatha Reddy J
Contributor
July 18, 2022

It is working when ever we changed the Priority_Number to 1. I just wanted when we creating the issue with priority number 1 then system/automation should check any open ticket is there with the same priority 1, if any open ticket with priority 1 then comment on the issue. If in case there are no open tickets with priority number 1 then no need to comment on issue.

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 18, 2022

Hey @Sreenatha Reddy J,

On that same issue trigger, you can properly set the issue operation to execute only when the issue is created:

Screen Shot 2022-07-18 at 13.42.01.png

Let us know if that works for you.

Sreenatha Reddy J
Contributor
July 19, 2022

Hi @Petter Gonçalves

The Automation is running when the Priority_Number is 1, but I want, when priority_Number giving as 1 while creating the issue, then Automation should check whether any open issues with priority#1 then Automation should run and comment the issue. If there are no open issue with priority#1 then automation should not trigger.

But with your automation rule when priority#1 then no matter whether any open issues are there with priority#1 or not the automation is triggering and commenting the issue.

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 19, 2022

Hey @Sreenatha Reddy J

Thank you for your feedback.

Actually, I tested the automation before sending it to you, and the behavior you mentioned does not match with the one I was able to achieve. In my case, the automation is checking if there are any open issues with priority#1, and it is not triggering if that is not the case.

That being said, I believe there are some JQL detail or automation settings that might be missing/misconfigured. Can you please provide us with a screenshot of your automation so we can properly check what might be happening?

On that screenshot, please provide us with the details you filled in the two conditions inside the automation.

Thanks!

Sreenatha Reddy J
Contributor
July 19, 2022

Hi @Petter Gonçalves ,

Can you please send the screen shots of your Automation conditions clearly, so that I will try. Please do this needful.

Petter Gonçalves
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 20, 2022

Hello @Sreenatha Reddy J

Here are the screenshots of each condition of my automation:

Condition 1:

Screen Shot 2022-07-20 at 16.50.39.png

Condition 2:

Screen Shot 2022-07-20 at 16.50.46.png

Let us know if you have any questions.

0 votes
Nick Haller
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 14, 2022

Hi @Sreenatha Reddy J ,

I've moved this question to the Jira queue as I believe it relates more to that product vs. Statuspage - which this was initially opened in. Let me know if that's not the case.

0 votes
Shivam Naik
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 13, 2022

Hi @Sreenatha Reddy J ,

Happy to help!

I want to clarify regarding the custom field you mentioned, are you referring to the Severity levels on Statuspage? If so, this would need to be a Feature Request since those values are available to all authorized Admins on Statuspage for all incidents. If possible, please provide a screenshot so I can make I'm understanding the question correctly.

Thank you!

Sreenatha Reddy J
Contributor
July 13, 2022

Capture.PNG

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events