Hello all,
I need you help to display the name of a custom field in a comment or notification.
How can I identify the field name correctly ?
Thanks for your help !
Marine
Hi @mgouirand - it would be helpful if you can provide a screenshot of your actual Automation Rule or the comment/notification part of it, so we can see what your "code" looks like. Thanks!
Hello @Darryl Lee Please find the screenshot of the automation and the existing rule.
Thanks for your help.
Kind regards,
Marine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you! I would try:
{{fieldChange.fieldName}}
{{fieldChange.field}}
{{fieldChange.name}}
(Weirdly on my test instance, I cannot even get {{fieldChange.toString or fromString}} to show me anything.)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK, tested, and it looks like we have a winner:
{{fieldChange.field}}
I hope this works for you! Also, it's important to note this limitation:
When there are multiple fields that have changed, {{fieldChange}} only contains the first changed value. If multiple values are changed, use # to iterate over these. For example, when setting multiple Fix Versions, then you can iterate over these using {{#changelog.fixVersion}}{{toString}}. Learn more about using smart values with sections and lists.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/
Alas, #changelog does NOT let you iterate through every field change if you don't know the field name, so this failed. Repeat, this does not work, but it OUGHT TO (IMHO) if Atlassian fixed it:
{{#changelog}}
{{#field}}
Field: {{field}}, "{{fromString}}" to "{{toString}}"
{{/}}
{{/}}
(Yes, this also would mean Atlassian would have to support nested list expansion, which they do not.)
It's SUPER-annoying.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @mgouirand ,
Use smart value "{{issue.Custom fieldname}}". Let me know if this works.
In the example below, we have a custom field called Team Leader, and the value of the field is currently Alana Grant.
{{issue.Team Leader}} returns Alana Grant
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @mgouirand
"I have no value at all." - Do you mean the field you want is not having any values in it ?
Please share the screenshot of your automation rule and a sample ticket with the field for further assistance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No it means that with "{{issue.Custom fieldname}}", now I have :
Field : , from "test@yahoo.com" to ""
instead of Field : customfield_10398, from "test@yahoo.com" to ""
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
By no value I mean that I have now :
Field : , from 'test@yahoo.com" to ""
instead of :
Field : customfield_10398, from "test@yahoo.com" to ""
Thanks,
Marine
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @mgouirand ,
I was not able to get any functions to get the custom field name.
As the value for custom field name doe snot change, is it not OK to just add field name in the rule itself ? i.e. Hardcode
Example: Update "Approvers" from {{issue.Approver2}} to {{issue.Approver3}}
Note: Approver, Approver2 and Approver3 are fieldnames
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Rilwan Ahmed
Thanks for your feedback.
Yes, it can be done, but we have created multiple custom field name.
Does it means that I have to create multiple automation for each case ?
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.
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.