People custom field not working on automation

Giulia Quaglia June 28, 2023

Hello everyone,

I am trying to set up an automation that place a comment on the task when it is assigned to a reviewer (custom field People already created).

 

The Reviewer shows me:

data-testid="issue-field-heading-styled-field-heading.field"

 

instead other custom field shows me the ID:

data-testid="issue-field-heading-styled-field-heading.customfield_11736"

 

The automation is working, so it stamps a comment but with no tag of the reviewer, it's useless.

 

Here the rule:

Schermata 2023-06-28 alle 20.45.11.png

 

If you check the layout, the name of the reporter is smaller that the Assignee.

 

Schermata 2023-06-28 alle 20.35.20.png

2 answers

0 votes
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.
June 29, 2023

Hi @Giulia Quaglia -- Welcome to the Atlassian Community!

Are you using a Company-managed or a Team-managed project?  You may find that information at the lower-left of the expands area of the screen.

To mention someone in a comment (or other text field), please use this format, substituting in your custom field information:

Here is my mention [~accountid:{{issue.yourCustomField.accountId}}]

Kind regards,
Bill

Giulia Quaglia June 30, 2023

Hi Bill,

at the moment we are using a team-managed project. 

Maybe this setting is not working properly, I've already checked that we have restricted possibility to customize the project.

Here below the screenshot:

 

Schermata 2023-06-30 alle 10.07.27.png

 

I've tried to use:

- {{issue.customfield_XXXXX}}

- {{issue.fields.customfield_XXXXX}

- {{issue.yourCustomField.accountId}}

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.
June 30, 2023

Thanks for confirming your project type as there are known problems with accessing the People fields in team-managed projects to send notifications.  Here are a couple of the defects/suggestions around that symptom:

https://jira.atlassian.com/browse/JSWCLOUD-20774

https://jira.atlassian.com/browse/AUTO-519

I am going to experiment with this a bit to see if I can find a work-around.

Like Giulia Quaglia likes this
0 votes
Esther Strom
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 28, 2023

Hi, @Giulia Quaglia  - welcome to the Community!

It sounds like the reason you're unable to make this work is that you don't know the custom field ID of your Reviewer field. If you're not a Jira admin, the easiest way to get that value is to look at an issue you have access to (with a value in the field) via the API. 

Just put this in your browser's URL bar:

 https://<your-site>.atlassian.net/rest/api/3/issue/TRAS-4254?expand=names

Replace <your-site> with your actual site URL, and replace TRAS-4254 with your ticket number. Hit enter, and it will give you a screenful of unformatted json data. You can use any program you like that will format json (Notepad++, etc.) or paste it into the text screen at https://jsonviewer.stack.hu/. Then click to the Viewer screen to view your ticket data as a formatted tree. Go to the names section and find the ID that matches your field name. For example, in my screenshot, the field called Esther User Picker is customfield_10610 .

2023-06-28 16_02_20-Online JSON Viewer - Brave.png

 

You can then use that in your automation rule as {{issue.customfield_10610}} with whatever the ID is for your field.

Giulia Quaglia June 30, 2023

Thanks Esther for you help! I've found the custom field ID on the JSON.

Automation with {{issue.customfield_10610}} still does not work, maybe it is related to the fact that we are in team-managed company

Jehan Bhathena
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 8, 2023

Hi @Giulia Quaglia ,

from your above comment it looks like you're passing the complete field value, if this is a User related field you'll need to make thr output more specific, taking reference from @Bill Sheboy 's answer try using this as the comment (Square bracket is for tagging)

 [~accountid:{{issue.customfield_10610.accountId}}]

 

Using user smart values: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-users/

----

Update: I tested this at my end, and this worked to tag the approver of my ticket, similar should work with the "People" custom field :

[~{{approval.approver.accountId}}]

image.pngimage.png

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events