Forums

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

Write JQL Based on Start Date and Close Date

Digvijay Singh
Contributor
April 3, 2025

Hi Community, 

I want to write JQL query for Start Date and Close Date so that I can use them in single Jira automation rule. 

For example: Date format - mm/dd/yyyy

  • Start Date = 01/01/2025 
  • Close Date = 06/30/2025
  • Revised Date = Date calculated based on Start & Close dates
  • Single select field "Phase" has three values: Pre-Assign; Assign-To-Close; Not Closed

Conditions:

  • If Phase = Pre-Assign then set Revised Date = 12/31/2024 i.e. Start Date -1
  • If Phase = AssignToClose then set Revised Date = 06/29/2025 i.e. Close Date -1
  • If Phase = Not Closed then set Revised Date = 07/01/2025 i.e. Close Date +1

So, I want to set the date of Revised Date field based on combination of Start Date, Close Date, and Phase field value. 

Please guide if we can achieve the above conditions using JQL or something can be configured using Scriptrunner. 

Thanks

1 answer

5 votes
Fazila Ashraf
Community Champion
April 3, 2025

Hi @Digvijay Singh 

With the automation, have action to edit issue and set the value of 'Revised date' to {{issue.customfield_xxxx.minusDays(1)}}   matching the startdate/close date field id with the combination of conditions matching your business logic.

Digvijay Singh Gehlot April 3, 2025

Hi @Fazila Ashraf 

Thank you so much for your message. It helped. 

Like Fazila Ashraf likes this

Suggest an answer

Log in or Sign up to answer