Forums

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

Not able to update issue field through advance automation

vyanktesh_chandely January 9, 2023

Hi,

I'm trying to update one of the issue fields through "advanced" option in JIRA automation rule of "edit issue" (Since this field is not coming as a default in the list of fields which I can edit like team name etc, hence I have to take the advance option)

My task is :

Update the custom field A to "Industry" AND custom field B to "Industry" for all the issues in project "GAG"

Thank You

2 answers

1 vote
Ste Wright
Community Champion
January 9, 2023

Hi @vyanktesh_chandely 

What does your rule look like now? It'd be good to see what your current advanced update option looks like, so we can help suggest changes to make it work.

It'd also be good to know why the custom fields are not visible in the normal, simple list. Can you clarify...

  • What custom field type are the two fields?
  • Are these fields on the screen?
  • Are these fields visible to users (eg. not hidden using a Field Configuration)?
  • Is the Trigger for this rule Issue Created? Or a different Trigger?

Ste

vyanktesh_chandely January 9, 2023

Hello @Ste Wright 

  • What custom field type are the two fields? - 
    • A= (multiple choice)
    • B= Select List (cascading)
  • Are these fields on the screen?
    • Yes
  • Are these fields visible to users (eg. not hidden using a Field Configuration)?
    • Visible to the user, it comes when an issue gets created.
  • Is the Trigger
    • When Project = GAG

My requirement is to update these two custom fields to value = "Indudstry" for all the new issues and existing ones.

 

Thanks

vyanktesh_chandely January 9, 2023

@Ste Wright 

Hey,

 

  • Is the Trigger for this rule Issue Created? Or a different Trigger?
    • Right now its issue created 
Ste Wright
Community Champion
January 9, 2023

Hi @vyanktesh_chandely 

I've created the whole rule below, as two options:

  • Option 1: Set the Multi-select field using the "simple" edit option, and the Cascading field using the "advanced" settings. This is because the Multi-select field should be possible to set using the simple editing
  • Option 2: Set both fields using the "advanced" settings

Note: I've used the custom field IDs in the advanced settings, rather than the name. This helps protect the fields in future from duplicates, etc.

---

Option 1

  • Trigger: Issue Created
  • Condition: Issue Fields Condition
    • Field = Project
    • Condition = equals
    • Value = GAG
  • Action: Edit Issue
    • Field = <Multi-Select Field Here>
      • Option = Industry
    • More Options, Additional Fields
      • {

        "fields": {

        "customfield_10123": {"value": "Industry"}

        }

        }

Notes: 

  • customfield_10123 would represent the field ID for your cascading field

---

Option 2

  • Trigger: Issue Created
  • Condition: Issue Fields Condition
    • Field = Project
    • Condition = equals
    • Value = GAG
  • Action: Edit Issue
    • More Options, Additional Fields
      • {

        "fields": {

        "customfield_10456": [{ "value" : "Option 1"}],

        "customfield_10123": {"value": "Option 1"}

        }

        }

Notes: 

  • customfield_10456 would represent the field ID for your multi-select field
  • customfield_10123 would represent the field ID for your cascading field

---

These should work for newly created Issues.

For "existing Issues" - I'd recommend just using bulk change (bulk edit) as it's a one-off, rather than using an automation rule. See instructions on how to do this on this help page

You could use Automation if you wanted to though - for example, use the Trigger to "Scheduled" instead, and use these settings...

  • The "run" settings can be set to anything - you'll only run the rule once
  • Check the box next to Run a JQL search and execute actions for each issue in the query.
  • Set JQL = project = GAGto locate all the Issues. You could also limit it to Issues where the fields aren't set if preferred
  • Uncheck the box next to Only include issues that have changed since the last time this rule executed

Then, publish the rule. You can then press "Run rule" to immediately run it and updated all relevant issues.

I'd recommend creating a separate rule for this - as you could then deactivate/delete the rule after it has run. It should not be needed again due to the Issue Created rule adding the field values for all future issues.

---

Let us know if this works for you!

Ste

Like # people like this
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 9, 2023

Hi @vyanktesh_chandely 

Adding to Stephen's answer...

If you find the conditions are still failing in your rule after the Issue Created trigger, that can happen because the rule fires too quickly.  The fix for that is to add a Re-fetch Issue action immediately after the trigger.  That will slow down the rule and reload the data before processing continues.

Kind regards,
Bill

Like Ste Wright likes this
0 votes
Mahesh Shinde
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 9, 2023

Hi @vyanktesh_chandely :

 

Could you please, let us know what type error are you getting through automation?

 

Regards,

Mahesh Shinde

vyanktesh_chandely January 9, 2023

Hello Manish,

There's no error. The query I am using is :

1- Issue Created (Trigger)

2 - When Project = GAG (Condition)

3 - Action

{
"fields": {
"Verticals": "Studio & Industry"
}
}

Mahesh Shinde
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 9, 2023

Hi @vyanktesh_chandely :

 

Thanks for the reply.

Could you please show me the automation rules log? if there is failed log, then please share here.

 

Regards,

Mahesh Shinde

vyanktesh_chandely January 9, 2023

Thanks @Mahesh Shinde for the prompt response.

Sharing the audit log error :

"Specify the value for Verticals in an array (Verticals)"

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events