Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,298,120
Community Members
 
Community Events
165
Community Groups

Is there a way to change a default field based on a change in a custom field using Advanced Options?

Edited

Scenario:
User changes `Functional Team` to `A`.
Automation changes `Team` to `A`.

I'm trying to figure out a way to reference a custom field in the Advanced Field Editing options.

This is what I've tried so far:

{
    "fields": {
        "customfield_12000": { "title": "{{customfield_11701.value}}" }
    }
}

Is there a way to change a default field based on a change in a custom field using Advanced Options?

Thank you!

Screen Shot 2021-06-16 at 12.47.08 PM.png

2 answers

1 accepted

0 votes
Answer accepted

There is no way to update the "Teams" field that appears in Advanced Roadmaps by using Automation at this moment.

This page discusses Advanced Editing in the Automation feature, including referencing custom fields.

https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/

Thank you for responding! That's the link I'm referencing. I couldn't find how to reference another field, hence my pseudo-code.

First, I think the trigger for your rule is incorrect.

You scenario says "User changes 'Team' to 'A'" and then Automation changes field 'Functional Team'.

Your trigger needs to be When Value Changes for Team.

Second, what types of fields are this; single selection list, text fields, ...? 

Per the documentation, you can reference a custom field by its name or its ID:

Screen Shot 2021-06-16 at 1.38.41 PM.png

But the code to set field 'Functional Team' to match the value of field 'Team' may be different depending on the types of these two fields.

Like Peter Yoon likes this

First, I think the trigger for your rule is incorrect.


The image is correct. My comment was incorrect. I edited my original post for accuracy. Thank you for pointing that out!

Second, what types of fields are this; single selection list, text fields, ...?

Functional Team: Select List (single choice)
Team: Team

Team is a locked default field from Jira.

{
    "fields": {
        "Team": "Functional Team",
    }
}

^ Would this be the JSON object?
I'm still not sure what to add in the place of "Functional Team".

Hi @Peter Yoon 

Adding on to what Trudy suggests, if you are unsure what the smart value of your field is, please use the technique described here to find it:

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

Then try this for a single-select field, replacing your custom field numbers to match what you learn:

{
"fields": {
"customfield_1234" : { "value": "{{issue.customfield_4567}}" }
}
}

Best regards,

Bill 

Like # people like this

Excellent, @Bill Sheboy ! I was trying to find the info on referencing the value of a custom field. You got to it faster than me! 

We don't use Team in our Jira instance so I can't say for sure how this would work.

From a response on the below post, it appears that the Team field can be set, but it seems like it needs to be set to the ID number for the team.

https://community.atlassian.com/t5/Advanced-Roadmaps-questions/Can-Automation-set-the-Team-field-when-an-issue-is-assigned/qaq-p/1616145

If that is the case, then you are going to have to find a way to determine which Team ID matches the name in the Functional Team field.

If it is actually possible to set the Team field directly from the Functional Team field value, then Bill's suggestion should work. You should be able to replace "customfield_1234" with "Team", and you would need to find the custom field ID number for your "Functional Team" field to use in place of "4567".

Like # people like this

@Bill Sheboy Thank you for the reference. This is very helpful! Found the customfield IDs.

customfield_11701.title should change customfield_120000.value.
I'm running into "Error while parsing additional fields. Not valid JSON."

This is one of the solutions I've tried:
```
{
    "fields": {
        "customfield_12000.title": { “value”: “{{customfield_11701.value}}” }
    }
}

```

These are the customerfield IDs:
```
{
    "fields": {
        "customfield_12000": {
            "id": "9",
            "title": "ABC",
            "isShared": true
         },
        "customfield_11701": {
            "self": "https://<instance>/rest/api/2/customFieldOption/<some ID>",
            "value": "XYZ",
            "id": "12279"
        }
    }
}
```

Peter, please try this one to just set the ID field and see if that helps.  Watch out for the quotation marks changing to curly/slanted type as the JSON won't like those.

{
    "fields": {
        "customfield_12000": { "id": "{{customfield_11701.id}}" }
    }
}

   

Like Peter Yoon likes this

@Bill Sheboy Thank you. This seems to get us closer to what we need.

I'm receiving this error:

Error editing issues
TS-1 (The Team must be a string (customfield_12000))

Should the JSON object be:

{
"fields": {
"customfield_12000": { "title": "{{customfield_11701.value}}" }
}
}

 

Hmmm...maybe?  With the smart value (field) updates, it isn't always clear what is needed. 

How about writing the smart value ...

{{customfield_11701.value}}

to the log in one action, and confirm it contains what you expect for the value as you try JSON for the edit in the other action?  That will help isolate what is working/not working.

The smart value above works. But I'm still getting the same error. 

I reached out to Jira support to get more clarity on the issue. I'm hoping that it's a simple data input/syntax type issue that's easily solvable.

I'll keep y'all posted!

Thank you, @Bill Sheboy @Trudy Claspill, for all the help so far.

I hope that this thread can be a source for a solution later.

Like Bill Sheboy likes this
Jae Eddison Atlassian Team Jul 04, 2021

*

@Peter Yoonwere you able to find a solution for this issue?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
Community showcase
Published in Jira Software

Upcoming changes to epic fields in company-managed projects

👋 Hi there Jira Community! A few months ago we shared with you plans around renaming epics in your company-managed projects. As part of these changes, we highlighted upcoming changes to epics on...

14,818 views 37 48
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you