Forums

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

How to create automation in Jira for each issue by custom field date?

Vladimir Sumilin
Contributor
February 9, 2023

I have all my issues with different dates and I need to create automation, which will create the same issue after 1 year. I have added a custom field like "Training date" in my project. For each issue, it's a different date, so I can't say that it should create an issue after 1 year, it should be a specific date for each issue. 

 

How to do this? 

 

Thanks

2 answers

1 accepted

3 votes
Answer accepted
Magdalena Zhisheva
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.
February 9, 2023

Hi @Vladimir Sumilin ,

You can try to built this automation:

Screenshot 2023-02-09 at 11.13.28.png

Screenshot 2023-02-09 at 11.14.13.png

The JQL I would use in this case as part of the scheduled trigger is Project = xxx and training date = startOfDay(-1y)

Hope it helps!

Magdalena Zhisheva

Vladimir Sumilin
Contributor
February 9, 2023

Hi Magdalena,

 

I'm getting an error when I'm trying to make it as you said: 

error.PNG

Kelly Arrey
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.
February 9, 2023

Try `Project = "Training Records" and "Training Date" - startOfDay(-1Y)`

  • JQL doesn't recognize Training Records as a project name without the quotes
  • Similarly JQL doesn't recognize Training Date as a field name without the quotes
  • Don't forget the Y in "startOfDay(-1Y)"
Like # people like this
Vladimir Sumilin
Contributor
February 9, 2023

Hey Kelly,

Thanks for the reply, but I still have an error: 

kelly.PNGproject.PNG

Kelly Arrey
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.
February 9, 2023

Augh!!!! I had a typo in my response to you. My apologies. Try:

`Project = "Training Records" and "Training Date" = startOfDay(-1Y)`

 

Sorry about that.

Like Vladimir Sumilin likes this
Kelly Arrey
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.
February 9, 2023

But it seems that "Training Records" is not a valid value for the "Project" field in your Jira instance, so I think you'll need to figure out what project you want to query, or investigate whether your Jira instance has two fields named project.

Like # people like this
Magdalena Zhisheva
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.
February 9, 2023

I would add to use project key instead of the project name.

When I have troubles with JQL in Automation rules, I usually go to Filters -> Advanced search in a new tab and build the query there first with the suggestions list, so I can be sure that it's working. Once it's working,  you can paste it to the Automation rule.

Hope it helps!

Like # people like this
Vladimir Sumilin
Contributor
February 9, 2023

Thanks for your replies, 

Jira can understand now the project name, because I am using only the project key, but he gave me another error about startOfDay. 

 

My JQL:

Project = "TR" and "Training Date" = startOfDay(-1Y)

 

Error:

Invalid JQL

Duration for function 'startOfDay' should have the format (+/-)n(yMwdm), e.g -1M for 1 month earlier.

Vladimir Sumilin
Contributor
February 9, 2023

I found out why I had the last problem because Y should be small y and then it's working. Thanks for the help guys! :) 

I have only one concern that it says it will start the next Thursday. Please check the screenshot below: 

concern.PNG

Is the basic also working or I chose that JQL only will work? 

 

Thank you anyway! :) 

Magdalena Zhisheva
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.
February 10, 2023

Hi @Vladimir Sumilin ,

Please, check my screenshotScreenshot 2023-02-09 at 11.14.13.pngYou may schedule to run every day, so the JQL check will trigger any further actions.

Let me know if you need any other details

Vladimir Sumilin
Contributor
February 10, 2023

Hi Magdalena, 

I'm confused now. I will try to explain my concern. 

I have this query in JQL:

Project = "TR" and "Training Date" = startOfDay(-1y)

My question: is it only this query working? (I need to make it only once a year) 

But for me it's saying that it will run next Thursday, what I actually don't need. 

 

Best regards,

Vladimir

1 vote
Magdalena Zhisheva
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.
February 10, 2023

Hi @Vladimir Sumilin ,

The rule I proposed means:

Everyday perform a search for tickets where the training date is on the same date last year  and clone it.

So you need to schedule it to perform the check every day and if there is an ticket with a training date on the same date last year, it will be cloned.

Hope it makes sense!

Vladimir Sumilin
Contributor
February 10, 2023

Thanks! That makes sense :) 

Like Magdalena Zhisheva likes this

Suggest an answer

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

Atlassian Community Events