The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

JQL query with multiple IF statements

Andile Luvuno
Contributor
January 12, 2022

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

3 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 13, 2022

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.
TAGS
AUG Leaders

Atlassian Community Events