I can't figure out why this automation is returning nothing (and therefore not setting the due date as expected.
I've created the log step and all looks to work fine until the last step as seen here:
It shows that a work item has been edited, but nothing changes. I added it to the description field to eliminate any date format issues and that shows as blank, same as the output in the log.
I've run out of ideas of what the issue could be so asking here.
Welcome to the Community!
Try using the following:
{{created.plusDays({{SecuritySLA.get(customfield_10352)}})}}
Hope it helps!
Hi @michelle_brideau -- Welcome to the Atlassian Community!
The values in created variables and lookup tables are normally plain text. To use them as a number they must be converted with the asNumber function. Please try adding that after the get() function call:
{{issue.created.plusDays(SecuritySLA.get(issue.customfield_10352).asNumber).jiraDate}}
I also added .jiraDate to the end as you are trying to set the Due Date with that expression, and so the time part should be removed.
To learn more about using variables as numbers, please see this article I wrote on the topic.
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.
Thank you, that's what I've been looking for, I was trying to figure out if it was treating the number returned from the look up table as a string or integer. No examples shows doing this so I didn't know what the Jira term for .asNumber would be. I will go read more in your article.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helped!
FYI for my earlier note about "lookup tables are normally plain text"...Unlike a created variable, lookup tables preserve the typing of the values.
You probably typed in the text / values for the lookup, and so they were plain text strings. If instead the value came from a smart value, work item field, or even an entire object (e.g., like {{lookupIssues}} ) the type is preserved for use later. This can be handy to do things like saving the results of an entire Lookup Work Items action for later use :^)
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.