I'm looking to run automation to replace a portion of my description with a custom field value
What I'm after is something like this:
There are certain fields we want people to update under certain circumstances, but we don't want them required for other reasons. So I've decided to put a note in the description. The list says all the fields to update. When the field has a value in it, I want the message replaced with the field value:
So by default the description would be:
Due Date: Go to the due date field and set value
When field is set it:
Due Date: 2/6/25
The syntax is is:
{{issue.description.replace("date", issue.dueDate)}}
Automation is replacing "Go to the due date field and set value" with the field value
The error I'm getting back typically is something like this:
Hi Danielle - Welcome to the Atlassian Community!
The fastest thing to do right now would probably be to have a custom Paragraph (multi-line text) field with the generic description default value but with:
Due Date: {{issue.duedate.jiraDate}}
Then update your rule so that it triggers on field value changed: Due Date and add a condition for Due Date is not empty.
Then at an action for Edit Issue and select the Description field. Copy the the field for the current issue from your custom field.
I am sure you can probably do a substring and replace the text, but I don't have time to research all of that right now. :-)
Hi @Danielle Drapeau -- Welcome to the Atlassian Community!
Adding to John's suggestions:
The replace() function takes two text strings as parameters, but you are passing the Due Date directly (which is a date / time represented as a number). Please try updating that to use the format you want as a text string. For example:
{{issue.description.replace("Go to the due date field and set value", issue.duedate.format("MM/dd/yyyy"))}}
Even this approach could be error-prone: someone could alter that template text in the Description field, leading to a mismatch. Please consider what people may do entering the fields if you want the rule to handle the cases, perhaps using the separate field John suggests.
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 for your suggestions. I will try that.
Beyond the due date replace, I will be replacing with custom fields as well. I was unable to get those to work either. They are either single or multi select picklists.
My syntax was similar to above:
{{issue.description.replace("Go to the due date field and set value", issue.customfield-xyz-code)}}
Do I need to do something similar with the format here too?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That depends upon the field type as replace() takes text.
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.