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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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,466,911
Community Members
 
Community Events
176
Community Groups

Set Entity Property for Date Picker field with calculated value

Edited

Hi folks,

 

I'm looking for another perspective on how to set a custom field with a calculated date value based on an automation trigger. I'm able to create the calculated date value with the help of @Bill Sheboy and this post, but I am having difficulties in setting the calculated date value via the "Set Issue Property" (aka "Set entity property") action. Here is the full automation:

automation log.png 

 

You will see I created a variable {{newDate}}, which is:

{{issue.customfield_10037.plusBusinessDays(fieldChange.from.toDate.diff(fieldChange.to.toDate).BusinessDays)}}

 

This does return the correct calculated date value. However, when I use the "Set Issue Property" (aka "Set entity property") action with either of the screenshotted configurations below, the logs note "Successfully set entity property." but the entity property isn't changed. 

 

set entity property 1.pngset entity property 2.png

 

I'm pretty sure there's a simple thing I'm missing here, but I'm spinning my wheels at this point.

 

Thanks in advance for help!

2 answers

0 votes
John Funk Community Leader Jun 29, 2022

@Oliver Monaco  - Did Bill's solution above solve this for you? 

Thanks for following up @John Funk. Apologies for not closing this loop, but I believe I found that "Set Entity Property" wasn't working for this purpose. I was able to use "Edit Issue" and use the following body to push the date.  In this block, {{ newStartDate }} is of course a smart variable with the newly calculated date

 

{
"fields": {
"Start Date Field": " {{ newStartDate }} "
}
Like Bill Sheboy likes this
John Funk Community Leader Jun 29, 2022

Great! Glad you were able to get it solved!

0 votes

Hi @Oliver Monaco -- Welcome to the Atlassian Community!

This is curious...it appears you double-posted this question, and my answer in the first one was deleted when the duplicate was deleted!  Oh well...

I have seen the set entity property action in automation rules does not work when there are non-alphanumeric characters in the key.  Yet such keys do work in the REST API. 

Please try removing the underscore from your key and see if that makes a difference.

Kind regards,
Bill

Thanks for the quick response @Bill Sheboy !

 

I've tried your suggestion and used the "name" of the property without success unfortunately. customfield_10037 is the "id" and "key" of the field, and includes the underscore. I've tried removing the underscore as well just in case ("customfield10037") without success.

 

For the avoidance of doubt I have also pasted the formula directly into the "Set Entity Properties" action.

Screen Shot 2021-12-01 at 9.14.09 AM.png

 

Could there be a type issue when setting the entity property? Or a key issue somehow that I'm not realizing? I've also tried the below, and the custom field doesn't actually update with the now timestamp.

 

Screen Shot 2021-12-01 at 9.19.14 AM.pngScreen Shot 2021-12-01 at 9.19.04 AM.png

Sorry, but I am at the limits of my entity property knowledge on this one.  Something that helped me using properties was to call the REST API from a browser, adding the properties parameter, to see if the values were being set with a different key/value or at another scope level:

https://docs.atlassian.com/software/jira/docs/api/REST/1000.824.0/#api/2/issue-getIssue

If that doesn't show the values set and the automation log says there was no problem, I recommend working with your site admin to submit a ticket to the support team.  They may see something in the logs which we cannot access.  Please note that only customers on paid Jira licenses can submit to support.  https://support.atlassian.com/contact/#/

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events