Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

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!

1 answer

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
Community showcase
Published in Jira

Do you use Jira Cloud with Microsoft Teams?

Hi, Jira users! Do you use Jira alongside Microsoft Teams? We want to hear how you’ve used the power of Jira Cloud and Microsoft Teams (via the Jira Cloud for Microsoft Teams app) to achieve a team...

470 views 3 7
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