Set Entity Property for Date Picker field with calculated value

Oliver Monaco November 30, 2021

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 29, 2022

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

Oliver Monaco June 29, 2022

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
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 29, 2022

Great! Glad you were able to get it solved!

0 votes
Bill Sheboy
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.
November 30, 2021

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

Oliver Monaco December 1, 2021

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

Bill Sheboy
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.
December 1, 2021

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