Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,299,978
Community Members
 
Community Events
165
Community Groups

Due date separation

Hello, 

 

Does anyone know if there is a way to automate the DueDate to divide into 2 sections the tickets that come in. Let me explain

My finance team make 2 payment runs,

- one on the 15th for anything from the 30th to the 15th

- another payment run on the 29th of each month from the 16th to the 29th

I would love for Jira automation to be able to separate these tickets into sections. I have tried to use JQL to help me but am stuck. 

The end scope of this is to get the automation to label PR1 and PR2 to each of the tickets as soon as they are created. 

I have an automation set up to run on the 15th and 29th of each month but if a ticket gets created it doesnt go into any buckets.

 

Any help would be awesome

 

1 answer

0 votes

Hello @Renato Osorio ,

Thanks for reaching out to the community.

I played around with this a bit and came up with the following Rule using advanced compare conditions with smart values that I think will do the trick.  But there are a few caveats that apply that may alter how you apply the rule.

First I am applying a format conversion to the reporter's timezone covered in more detail in the following KB articles, but depending on what timezone you want to use this will most likely be different, i.e. you plan on running the billing cycle based on UTC or Mountain time you will want to set the time accordingly to the timezone that applies:

The rule I came up with is as follows:

  • When: Issue Created
  • IF: Matches
    • Advanced Compare condition
      • First value: 
        • {{now.convertToTimeZone(issue.reporter.timeZone).format("dd")}}
      • Condition
        • Less Than
      • Second Value
        • 16
    • NOTE: this triggers IF now(day of the month) is less than 16 so the first of the month to the 15th of the month will apply to the follow up action which is to set the due date to the 15th of the current month = {{now.withDayOfMonth(15)}}
    • AND: Edit issue Fields
      • Choose Field to set
        • Due Date
      • Due Date: Value
        • {{now.withDayOfMonth(15)}}
  • Else if: matches
    • Advanced compare condition
      • First value: 
        • {{now.convertToTimeZone(issue.reporter.timeZone).format("dd")}}
      • Condition
        • Greater Than
      • Second Value
        • 29
    • NOTE: this triggers IF now(day of the month) is greater than 29 so the 30th and 31st of the month will apply to the follow-up action which is to set the due date to the 15th of the following month = {{now.withDayOfMonth(15).plusMonths(1)}}
    • AND: Edit issue Fields
      • Choose Field to set
        • Due Date
      • Due Date: Value
        • {{{now.withDayOfMonth(15).plusMonths(1)}}
  • Else if: All Match 
    • Advanced compare condition 1
      • First value: 
        • {{now.convertToTimeZone(issue.reporter.timeZone).format("dd")}}
      • Condition
        • Less Than
      • Second Value
        • 30
    • Advanced compare condition 2 
    • NOTE: This is applied by selecting the "+ Add conditions...." option under the else
      • First value: 
        • {{now.convertToTimeZone(issue.reporter.timeZone).format("dd")}}
      • Condition
        • Greater Than
      • Second Value
        • 15
    • NOTE: this triggers IF now(day of the month) is greater than 15 and less than 30 (Both conditions must apply) so the 16th to the 29th of the month will apply to the follow-up action which is to set the due date to the 29th of the current month = {{now.withDayOfMonth(29)}}
    • AND: Edit issue Fields
      • Choose Field to set
        • Due Date
      • Due Date: Value
        • {{now.withDayOfMonth(29)}}

Give this a try and let me know if it does the trick

Regards,
Earl

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Published in Jira Service Management

Coming Soon: Insight Changing to Assets

The 2020 acquisition of Mindville added powerful asset and configuration management capabilities to Jira Service Management in the form of Insight. Following the completion of that integration, custo...

467 views 3 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you