Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

JQL query with multiple IF statements

Good Day All.

I'm looking for a JQL statement that would cater for the below:

      • If Severity = 1; and Time to Attend < 5hrs ; Change status to YES
      • If Severity = 2 ; and Time to Attend < 9hrs; Change Status to YES
      • If Severity = 3 ; and Time to Attend < 12hrs; Change Status to YES
      • If Severity = 1; And Time to Attend > 5 hrs; Change Status to NO

Time To Attend(Date/Time Field)

Status(Text Field)

Severity(Dropdown/List Filed)

 

Your Assistance would be highly appreciated.

1 answer

3 votes

JQL is for finding issues, so that they can be used in reports.  It doesn't do anything more than that, certainly not changing issues.  JQL doesn't even have anything to say about the reports you're going to use to look at the resulting lists of issues (other than a sort order that some reports use).

What you will need to do to make the changes I'm reading from your pseudo-code is:

  • Run JQL to find the issues you want to change
  • When you run JQL, you get the results in the reporting function called the "issue navigator"
  • The issue navigator has a function in the options menu called "bulk edit"
  • If you use that, it will ask you what type of edit you want to make

You'll need to repeat that for each different query you have.

I think you have a few problems with your setup of these queries though. 

  • You should never have a text field called "status" - that word should be reserved for the display of the actual status of the issues.  (Avoid having the word status in any custom field name, it's a bad thing to use)
  • Your queries will not work.  "Time to Attend" is a date/time, not a duration.  I mean it holds something like "13/01/2022 10:02", not "5 hours", so your comparison won't work.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Service Management

JSM Jira Automation: How to Send SLA Breached Notifications

Hi Everyone, In   this tutorial,  we will show you how you can monitor an SLA, and send notifications before or after the SLA has been breached.   SLA Threshold Trigger The SLA t...

676 views 5 12
Read article

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