Forums

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

How to set creator of issue as the "auditor (a custom field)" of your issue in jira automation

Wendy Chen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 12, 2022

Rule background:

  • When an epic is created, it will create 5 stories linked back to that epic.

Goal:

  • I want the creator of the epic to be automatically assigned as the "Auditor" of the epic, and the Auditor of the stories that the automation will create. 
  • Auditor is a custom field

How can I accomplish this?

Thank you so much! 

1 answer

1 vote
Walter Buggenhout
Community Champion
July 12, 2022

Hi @Wendy Chen,

You should be able to create a variable (e.g. {{auditor}}, fill that with a smart value from the epic's reporter ({{issue.reporter.displayName}}) and then use the variable to set the auditor custom field of your linked issues while you are creating them.

Hope this helps!

Wendy Chen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 13, 2022

So in the automation rule structure, would I include a New Action after the epic is created, select Edit issues field, choose the Auditor field, and input ({{issue.reporter.displayName}}). 

And then in blocks that create the stories, select Audit field to be filled, and copy from the Epic?

Walter Buggenhout
Community Champion
July 13, 2022

Not exactly, @Wendy Chen.

I was thinking you 'd have an automation rule that responds to the issue created trigger, checks if the issue created is an epic and after that condition:

new action: set variable (name: {{auditor}}, value {{{{issue.reporter.displayName}}}}

And then, when you create the 5 issues in that epic, use the {{auditor}} variable to set the Audit field of the issues. 

Like Bill Sheboy likes this
Wendy Chen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 13, 2022

Is this how I set the variable up? The second image is trying to edit the Auditor field of the epic issue that is created. 

 

Screen Shot 2022-07-13 at 10.01.52 AM.pngScreen Shot 2022-07-13 at 10.01.59 AM.png

 

However, I ran this rule and the error said "

Create issue
Unknown fields set during create, they may be unavailable for the project/type. Check your custom field configuration. Fields ignored -
Auditor (customfield_28180)"
Walter Buggenhout
Community Champion
July 13, 2022

Hi @Wendy Chen,

Yes. As the error message says: check your field configuration. The auditor custom field must be on the create screen of the issue (type) you are trying to manipulate. Otherwise it can't be filled out.

Wendy Chen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 13, 2022

Would I change it to this?

Screen Shot 2022-07-13 at 10.09.27 AM.png

Walter Buggenhout
Community Champion
July 13, 2022

No, you must ensure that the auditor custom field is present on the create issue screen in the project where you want to create your issues (or on the edit screen if you are trying to edit existing issues).

Navigate to the project where you are trying to create issues, navigate to project settings > screens, locate the screen scheme used for the issue type you need and make sure the custom field is on the create screen.

Wendy Chen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 13, 2022

This question that was asked by someone else represents what I wanted to do:

https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Automation-for-JIRA-Set-Custom-User-Picker-Field-by-user-who/qaq-p/1259148 

The auditor custom field is not a textfield and is a user-picker-field. I still wasn't able to figure out how to assign the reporter as the auditor, and the audit log kept saying "Fields ignored - Auditor (customfield_28180)". The auditor field is on the create screen of the issue I'm trying to create, so I'm not sure what is wrong. 

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.
July 13, 2022

Hi @Wendy Chen 

To do that, please use the accountId as referenced in that linked post.  For example, when editing the auditor field you may type in this smart value, it will appear below the field, and then you can select it:

{{issue.reporter.accountId}}

If you want it from the trigger issue instead, and I believe you do for your rule, instead please try:

{{triggerIssue.reporter.accountId}}

 

Kind regards,
Bill

Like # people like this
Wendy Chen
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 13, 2022

When I'm editing the auditor field, the Auditor (textfield) and Auditor (userpicker) options appear. The userpicker does not let me input my smart value, and has pre-determined options to select from (i.e. copy from parent issue, epic issue, etc). Since the auditor field is not a textfield on my screen, inputing the smart value in the Auditor (textfield) option doesn't work either. 

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.
July 13, 2022

Did you try what I suggested for the user picker field for the edit action:

  • type in your smart value
  • the smart value will appear below the field
  • select that value below the field
  • it will now be used to populate the field for the edit
Like # people like this
jun lee
Contributor
January 15, 2023

Hi

 

In my case, I am trying to update value to a number field. Can you advice for me?

JIRA Agent user has a administrator role, and the custom field is in a field configuration scheme of this project and screen of this issue type. 

2023-01-16 14 45 43.jpg2023-01-16 14 46 21.jpg2023-01-16 14 46 38.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.
January 16, 2023

Hi @jun lee 

Have you confirmed the smart value for your field to use in the JSON advanced edit?  Please note that the smart value may not exactly match the name of the field on the screen or what is shown in drop-down lists.

You can find and confirm the smart values for supported fields using this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

Kind regards,
Bill

jun lee
Contributor
January 16, 2023

Hi

The custom field has not smart value. I can find just name of the filed as 

"customfield_13500":"ENM_WorkPercent"

from xxx/jira/rest/api/2/issue/ENMCOMM-340?expand=names.

 

As I mentioned before, it is a number field.  Is number field has smart value, too?

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.
January 17, 2023

Based on what you show, the custom fieldname or ID will work as a supported smart value.  Please try using this example to set a number field with your JSON expression:

https://support.atlassian.com/cloud-automation/docs/advanced-field-editing-using-json/#Number-custom-field

jun lee
Contributor
January 17, 2023

It sill doesn't work.

2023-01-18 10 44 22.jpg2023-01-18 10 44 00.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.
January 18, 2023

Is your field defined on the edit view?  When it is not present a field cannot be edited by a rule.

Who is the rule actor (i.e. user) in the details section of the rule?  Has this been changed from the default of "Automation for Jira"?

jun lee
Contributor
January 18, 2023

the field defined on create, and edit screen. Actor is Jira agent has an administrator role.

2023-01-19 15 38 14.jpg

 

 

2023-01-19 15 37 24.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.
January 19, 2023

You seem to have covered all of the things I know which could cause this symptom. 

At this point I recommend working with your Site Admin to submit a ticket to Atlassian Support for assistance.  If you are using a paid license for Jira the admin can do that here: https://support.atlassian.com/contact/#/

Suggest an answer

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

Atlassian Community Events