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:
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.
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!
@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 }} "
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great! Glad you were able to get it solved!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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/#/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.