Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Change Custom Field Based on Agnostic Date Ranges

Daniel Finley April 25, 2024

I have a custom field called 'Planning Quarter', and the request is to update this field based on the date ranges for the corresponding quarter. For example, if the planned start date is 01/01/24 to 03/31/24. I know I can set automation based on the strict date format. 

My question, is there a way to have it set as 01/01/XX to 03/31/XX so that it does not matter which year the automation rule is triggered?

1 answer

0 votes
Kalyan Sattaluri
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.
April 26, 2024

Hello @Daniel Finley 

Are your quarters based on calendar? so Q1 starts 1/1 and ends 3/31?

And also, just the Planned Start Date field will drive the quarter? No End Date?

There are probably many ways to do this but I would think you need a boundary to determine start and end. If you just have start date and user enters 3/30.. I dont think they are completing that work in Q1..

Maybe you need just 1 date.. so please clarify..

 

 

Daniel Finley April 26, 2024

Yes on your first two questions. I will apply similar logic for the end date, killing two birds with one stone.

I can see various ways to approach this, but a lot of ways to try. Mostly wanted to see if there is an optimal way to approach this to reduce maintenance.

Kalyan Sattaluri
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.
April 26, 2024

If I assume that an issue has to be between a start date and end date to be marked as Q1 for example, this is how I would do it.

  • Trigger = Scheduled or Field change or Issue created
  • Action = Refetch Issue (if trigger was issue created or field change)
  • Component -> If /Else -> if block = All Conditions match:
    • Condition 1 :
      • End Date 
      • Greater Than
      • Start Date
    • Condition 2: 
      • {{Start Date.monthOfYear}}
      • Less than
      • 4
    • Condition 3: 
      • {{End Date.monthOfYear}}
      • Less than
      • 4
  • Then Edit Issue => Update to Q1
  • Else block = All Conditions match:
    • Condition 1 :
      • End Date 
      • Greater Than
      • Start Date
    • Condition 2: 
      • {{Start Date.monthOfYear}}
      • Greater than
      • 3
    • Condition 3: 
      • {{Start Date.monthOfYear}}
      • Less than
      • 7
    • Condition 4: 
      • {{End Date.monthOfYear}}
      • Greater than
      • 3
    • Condition 5: 
      • {{End Date.monthOfYear}}
      • Less than
      • 7
  • Then Edit Issue => Update to Q2
  • Etc....

 

Please see screenshot below, modify Start Date and End Date to your fields if this is the logic you want to implement, or modify rule accordingly..

 

May seem like a lot of conditions within If, but can easily copy paste the smart values from text file and get it done.

Also, if there is a simpler approach, will update post or hopefully community can share one.

Please try and let me know..

image.png

Suggest an answer

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

Atlassian Community Events