Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Request for support on smart value for a table formation email

Rahul Jith December 28, 2023

Hi @Mark Segall ,

 

Hope you are doing well!

 

i want to add few custom field values on automation email for customer.

1. Custom Field - Scrum Master(user picker type)

2. Regression Required? (Single choice from drop down)

3. CAB date (date format)

4. CRQ (alphanumeric label type)

 

i tried below and getting blank outcome

{{Issue.fields.customfield_12xx}} - scrum master

{{Issue.fields.customfield_13xx}} - regression 

{{Issue.fields.customfield_14xx}} - can date

{{Issue.fields.customfield_15xx}} - crq

 

Can you help with the correct smart values for each. I have managed to get for all other non custom fields and stuck with this.

Also I have tried with .name, .value, . displayName etc t the end still get the blank value.

Also noticed for scrum master field when I removed issue at the beginning and runs with field.customfield_12xx it return me the I'd of the user like 69agdjsjmmqw12 but not the name.

 

Regards, 

  1. Rahul Jith

3 answers

2 accepted

2 votes
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 28, 2023

Hi @Rahul Jith 

Smart values are name, spacing, and case-sensitive.  And often the smart value does not match the displayed field name on the issue views.  The how-to article below helps to identify the correct smart value (and custom field id) for any supported fields for automation rules.

The essential steps are:

  • identify an issue which has your field(s)
  • call a REST API function with a browser to search for your issue:
https://<yourinstanceurl>/rest/api/2/issue/<issuekey>?expand=names
  • search on the page for your field, such as with CTRL-F
    • if you find the field, you will also find the smart value, custom field id, and structure / attributes it has
    • if you do not find the field, it is not supported by automation rules

https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

 

 

In addition, the field type impacts which attributes are available with the smart value.  For some examples:

  • User selection field
{{issue.myUserField.accountId}}
{{issue.myUserField.displayName}}
{{issue.myUserField.emailAddress}}
  • Single or multiple select option field
{{issue.mySelectionField.value}}
  • For a field with multiple values, it is a list field of the other types; individual items are often selected
  • For most other field types, the smart value is sufficient to return the value

 

Kind regards,
Bill

Rahul Jith December 28, 2023

Thanks @Bill Sheboy . This is really helpful guide. Let me explore it. Many thanks.

Rahul Jith December 28, 2023

Hi @Bill Sheboy

When I tried with fields.customfield_1234.value it worked for the single selecti drop. 

The same didn't worked for single or multiple label added field.(CRQ field mentioned above).

Also it's missing for the date picker field entry.

I tried with fields.customfield_1234("dd/MM/yyyy").value - this also returns empty.

User field is sorted. Many thanks


Screenshot_20231229-112848.jpg

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 29, 2023

First thing, I recommend removing the "fields." prefix as it is not needed.

 

Next, for the field you describe as a labels field type, that will be a list.  Just providing the field name should be sufficient to produce a comma-separated values list: {{myLabelsField.value}}

 

Finally, I am unclear what you are trying with this syntax:

{{customfield_10032("dd/MM/yyyy").value}}

What type of field is customfield_10032?  If it is a date or date / time picker, and you want to control the output format, please use this:

{{customfield_10032.value.format("dd/MM/yyyy")}}

To learn more about date / time formatting, please look here: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-format---

0 votes
Answer accepted
André Felipe Rodrigues Lopes
Contributor
December 28, 2023

Hello budy, how are you?
Try using the lowercase letter i instead of uppercase
For example
{{issue.fields.customfield_XXXXX}}
Using it like this worked and the value is sent to the email correctly
Tell me if it worked for you

Rahul Jith December 28, 2023

Hello @André Felipe Rodrigues Lopes ,

 

Yes it worked with few fields.

 

When I tried with fields.customfield_1234.value it worked for the single select drop. 

The same didn't worked for single or multiple label added field.(CRQ field mentioned above).

Also it's missing for the date picker field entry.

I tried with fields.customfield_1234("dd/MM/yyyy").value - this also returns empty.


Screenshot_20231229-112848.jpg

0 votes
Rahul Jith December 29, 2023

IMG_20231229_143147__01.jpgIMG_20231229_143051__01.jpgHi @Bill Sheboy @André Felipe Rodrigues Lopes ,

 

Finally it worked out. Many thanks for your support and guidance. It helped and it worked.

Cheers.

 

Attaching the screenshot of the alterations made and it's outcome.

Suggest an answer

Log in or Sign up to answer