Forums

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

Priority need to set 3 from 4 after 9days 2 hrs

Omprakash Thamsetty
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 Leaders.
October 1, 2021

I would like to set the priority based on the timeline. Example: Ticket is created and its not closed after 10 days then set the priority to 3 from 4

After setting the priority 3 then wait for 4 days and 2 hrs to change the priority to 2. 
Even if the ticket has not been closed then change the priority to 1 .

I guess we can do this using Automation for Jira plugin and script runner escalation service. Either Way, I need to get the JQL query to find if the ticket is 9 days 2hrs old then I will set priority 3. Can anyone help me how I can write the JQL query to get all 3 different priorities ?

I am using Jira server.  I don't have Service desk installed. 

Thanks,

Om

1 answer

0 votes
Bill Sheboy
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 Leaders.
October 1, 2021

Hi @Omprakash Thamsetty 

I suggest using the actual hour counts for the day ranges you want.  That will avoid any issues with working day/hour calculations that Jira may do.  For example for during 10 days ago from "now":

project = myProject AND created >= -240h AND created < -216h AND statusCategory != Done

As needed, you could adjust that using the startofDay() function to tune it.

Kind regards,
Bill

Omprakash Thamsetty
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 Leaders.
October 4, 2021

Hi @Bill Sheboy Thank you for the reply. I understand for 10 days from now. But how about the scenario 2. 

Scenario 1 is after 10 days change the priority to 3 from 4 works with the query that you have provided. 

Scenario 2 is after that 10 days again wait for another 4 days to change the priority to 2 from 3. How to write the query for 4 days after that 10 days?

Do I need to set the jql query is like startofDay(10) and 96h? Is below query work?

project = myProject AND created >= -96h AND created < startofDay(-10) AND statusCategory != Done

Thanks,

Om. 

Bill Sheboy
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 Leaders.
October 5, 2021

Given the complexities of your use case, one better approach would be to use a custom field for the next time frame to check rather than relying upon comparisons to the created date/time.  For example, at issue create set the value to +10 days, and clear/update the field when conditions permit.  (Such as for scenario 2.)

I suggest mapping out some examples and expected results, add the field, and then test your rules.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.13.4
TAGS
AUG Leaders

Atlassian Community Events