Forums

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

I am trying to write a JQL

Kelsey Knaus January 18, 2024

I am looking to create the following 

When an issue is status1 has a created date = 15 transition to status2

 

 

2 answers

0 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 Leaders.
January 18, 2024

Welcome to the Atlassian Community!

Created date = 15? That's only a few milliseconds into the 1st January 1970!  But that is me being picky.  

You can use dates in JQL with <, >, and =, so things like 

status = status1 and created > "15/1/2024"

or 

status = status1 and created = "29/2/2024"

will work as you expect them to.

There are also functions where you can ask it things like "created > startOfWeek()" or even "created > startOfMonth(-2)" which, today, would give you issues created since1st November last year.

Kelsey Knaus January 18, 2024

thank you! Honestly tad bit lost but I think I understand.  LOL 1970 is totally what I am looking for not. 

I am trying to create an automation to have the issue transition when the created date = 15 days ago

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 Leaders.
January 18, 2024

Ok, Jira uses an epoch time system, where date/time is stored as "the number of milliseconds elapsed since the 1st January 1970 00:00:00

Your query would be 

created > -15d

Although that is actually a 24 hour rolling time.  If ran it now, it would only get issues created after (my) 22:08 on the 3rd.   So I would use 

created > startOfDay (-15d)

0 votes
Trudy Claspill
Community Champion
January 18, 2024

Hello @Kelsey Knaus 

Welcome to the Atlassian community.

I don't understand your requirement.

What does "created date = 15" mean? "15" is not a date. Do you mean you want issues where the issue was created exactly 15 days ago?

Are you trying to get a list of issue to review, or a list of issues to automatically transition to status2?

Kelsey Knaus January 18, 2024

I think it may end up something similar to this 

WHEN an issue is created 

and IF Date same {{issue.created.isEquals(15).days}} 

THEN Transition to status 2

I think my problem here will be it will only trigger to issues created and after theyre created they wont check if the created date = 15 

Im trying to automate a system where when an issue is created, it tracks the days its created from, and when the created = 15 days ago then transition to status 2

Kelsey Knaus January 18, 2024

I hope that helps

Trudy Claspill
Community Champion
January 18, 2024

I would recommend you use a Scheduled trigger and run the rule daily.

In the Schedule trigger use this JQL:

project=X and created >= startofday(-15) and created =< endofday(-15) and status=status1

Each day that will get a list of the issues from project X that were created at some time on the date 15 days ago, and that are currently in status1.

Replace X with your project and status1 with the actual name of the status.

Also, make sure to uncheck the box that says "Only include issues that have changed"

Following the Schedule trigger add a Transition Issue action and in it select "status2".

That will transition all the issues found by the JQL to status2.

This assumes that there is a workflow transition between status1 and status2, and the Actor of the Automation rule has permissions in the project to make that transition happen.

Screenshot 2024-01-18 at 2.10.59 PM.png

 

Screenshot 2024-01-18 at 2.11.09 PM.png

Kelsey Knaus January 18, 2024

project=FIFU AND status=6-14Days AND created >=startOfDay(-15) AND endofday(-15)  This is what i have but i get the following errcoderror.pngor 

Trudy Claspill
Community Champion
January 18, 2024

You left out some required text:

project=FIFU AND status=6-14Days AND created >=startOfDay(-15) AND created =< endofday(-15) 

Kelsey Knaus January 18, 2024

error2.png

Trudy Claspill
Community Champion
January 18, 2024

I apologize. There's a typo in what I provided. 

Before "endofday" change the =< to <=

project=FIFU AND status=6-14Days AND created >=startOfDay(-15) AND created <= endofday(-15) 

Kelsey Knaus January 19, 2024

Thank you! It technically worked but I think i am still having trouble.  

I feel that it wont register the issues in the status for some reason.  When I test the query it shows 0 issues.  any thoughts on this?

Kelsey Knaus January 19, 2024

Does this rule apply to items that have not been created that day?

Trudy Claspill
Community Champion
January 19, 2024

Yes the rule selects only the items that are exactly 15 days old. An item created today cannot be 15 days old. It excludes issues that are more than 15 days old and issues that are less than 15 days old.

If the query is not providing the results you expect then can you provide screen images of issues you would expect to be included? You can obscure confidential data, but make sure the image includes the issue Status, Created date, and issue key.

Kelsey Knaus January 19, 2024

no action performed.pngsetup.png14 issues found.png

Kelsey Knaus January 19, 2024

for some reason the action is not performing at all.  It shows there are 14 issues then it should move right?

Kelsey Knaus January 19, 2024

these are the statuses.  I am trying to get anything thatis 15 days or older to move to the auto emailstatuses.png

Trudy Claspill
Community Champion
January 19, 2024

As I mentioned in my response where I outlined the steps of the rule, in the Scheduled trigger you need to uncheck the box below the JQL statement, where it says "only include issues that have changed..."

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events