Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to update a custom date field on existing issues to the Create date plus 3 business days?

I created a custom field "SLA Date" and want to populate this field on existing issues based on another custom field's value ("Severity Level"). 

I'm attempting to do this using the following Automation Rule:

When: Scheduled

    Every 5 minutes

For Current Issue

    Severity Level equals

           S2

Then: Edit issue fields - SLA Date - {{issue.createdDate.plusBusinessDays(3)}}

 

I've also tried: 

{{issue.created.plusBusinessDays(3)}} and

{{now.diff(issue.created).plusBusinessDays(3)}}

 

However, when I publish the rule and choose to "Run Rule", the SLA Date field is not updated.

I want to calculate this date for an S2 to be the date the issue was created plus 3 business days.

I have researched a couple of help pages, but can't seem to figure this one out (page 1, page 2). 

Thank you in advance for your assistance!

 

1 answer

1 accepted

1 vote
Answer accepted

Hello @Katherine Burkholder 

I suspect that your rule doesn't know which issue to act upon.

When you add the Branch condition and you select "For Current Issue" then the rul must have already selected an issue with a previous condition or trigger, from which it can identify the Related Issues upon which you want it to act in the branch.

Try using the JQL option for the Branch condition, and specifying a JQL to select 1..n specific issues to try your rule against.

@Trudy Claspill , so I do have the JQL on the schedule step, and it shows 119 issues found. 

The audit appears to show that it was successful, now. However, the values are not showing up in my query when I add the "SLA Date" field as a column.

I have this field hidden on the bug issue screen, but I should be able to see the value in a filter. At least it works that way on my auto rule when creating an issue. On that rule, I don't use "Scheduled" I use the "When: Issue created" trigger. And that shows the value in the SLA Date value in the SLA Date column on the filter correctly, but on that one, I use {{now.plusBusinessDays(3)}} - not sure how this is different. 

JQL.png

AuditLog.png

Filter.png

For debugging purposes can you use the Action "Log Action" to log the current value of the field and the new value(s) you are calculating?

 

On a side note, with regard to your attempt to use this

{{now.diff(issue.created).plusBusinessDays(3)}}

... there are a couple things wrong with that as per this document.

{{[date1].diff([date2]).[unit]}}

Returns the amount of time between date1 and date2, in the unit specified. If date2 is earlier than date1, the value returned will be negative. You can combine this with the smart value to return a positive value. 

It returns a quantity, not a date.

@Trudy Claspill - ah!  Ok, thank you! I finally got it to work using:

{{issue.created.plusBusinessDays(3)}}

 

Thank you so much for your help! 

In your first post you said you tried that and it didn't work.

Do you know what the root problem was?

@Trudy Claspill , yes, I didn't give the backend enough time to catch up. It was a timing issue. 

Hi @Katherine Burkholder 

As an FYI for your rule with a scheduled trigger on JQL, automation rules can only process up to 100 issues per execution.  You noted that when you ran/tested the JQL it returned 119 issues.

Something to watch for in the future as such a rule could take a few executions to complete all the work, processing in chunks when your JQL supports it.  For example, only looking for issues where the SLA Date IS EMPTY.

Best regards,

Bill

Like Trudy Claspill likes this

Thanks, @Bill Sheboy ! I had to modify my JQL to return less than 100 and it's working now.  Thank you!!

Like Bill Sheboy likes this

Oops... My bad if I explained that poorly.  Second attempt:

The JQL for an automation rule is permitted to return more than 100 issues...and only the first 100 will be processed.  That means if your rule needs to process them all, structure the rule so that is possible to process them in chunks...usually with repeated runs of the rule.  (e.g. your scheduled trigger with JQL  :^)

One thing to make that chunk-processing more predictable is to add an ORDER BY clause to the JQL.  You can then see progress as the chunks are processed more easily.

@Bill Sheboy - oh nice! I didn't know that...good advice. I'll try that. Thank you so much!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Jira issue check and more advanced commit verifications for Bitbucket DC

Pre-receive hooks that verify the Git commit message, the modified files, and implement similar code change controls used to be requirements of large enterprises working in regulated industries only....

24 views 0 1
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