Cannot set to empty a value using Edit field advanced

Sergio Montávez June 10, 2021

Hi,

I'm trying to set a custom field to empty using the Jira Automation rule "Edit field, advanced". The custom field is Parent Link, also customfield_12100. I can retrieve its info as I previously check a condition like this {{issue.customfield_12100.data.issueType.id}} and it works.

I get the JSON format using the jira API rest and this is it (it's within fields):

"customfield_12100": {
"hasEpicLinkFieldDependency": true,
"showField": true,
"data": {
"id": 96904,
"key": "JOE-32",
"keyNum": 32,
"summary": "JOE Saga test1",
"projectId": 12322,
"issueType": {
"id": "10649",
"iconUrl": "/secure/viewavatar?size=medium&avatarId=17582&avatarType=issuetype"
}
}
}, 

The goal is to set it to Empty so that custom field does not have a value. I've tried with the update + set method and also fields as described in the following link with no success: https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/

I'm doing it with an Advanced Field edit because there's a bug and Parent Link is not a selectable field in the Edit issue action dropdown (see image).
no parent link edit issue.png

Any chance on knowing why I can't do so or how to do it properly?

Thank you.

2 answers

1 accepted

4 votes
Answer accepted
Sergio Montávez July 6, 2021

I finally got this to work, let me provide the JSON:

{
"fields": {
"customfield_12100": null
}
}

Thanks everyone for being involved!

Marcel Rossouw February 9, 2024

I was knocking my head against a wall too regarding what parameters to use for amending a number of a custom field in Advanced Json for automation rules. It's in the documentation that merely states what you changed to above!

1 vote
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 10, 2021

Hi @Sergio Montávez 

Are you using a company-managed (classic) or team-managed (next-gen) project?  I am going to assume Team-Managed for now...

If you want to clear the parent (epic) of an issue (story, task, bug), you can use this JSON:

{
"fields": {
"parent": { "id": null }
}
}

 

Best regards,

Bill

Sergio Montávez June 15, 2021

Hi @Bill Sheboy 

I'm using a company-managed project and it didn't work for me. Nevertheless, I'm not interested in changing the Epic, I want to change a different parent, it's a custom issue type at the same level as Epics, so in child issues I have to reference it as Parent Link, not Epic Link, nor "issue is Parent of" by linking issues.

 

Thank you!

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 15, 2021

Hi @Sergio Montávez 

I suggest using the method described in this article to learn if your field has a smart value which can be accessed by automation rules:

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

If so, it may reveal a different name and structure in the JSON than what you expected when trying the edit.

Sergio Montávez June 16, 2021

Thanks for the link to the doc! Unfortunately, I already tried that out and couldn't do anything useful with it. As I said, I can retrieve info from this custom field but nothing more than that.

expand names.png

 

I also checked the edit meta with no success: https://<yourinstanceurl>/rest/api/3/issue/<issuekey>/editmeta 

edit meta.png

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 16, 2021

@Sergio Montávez at this point I am unclear what else to try.  As you are the site admin of a paid license for Jira, you should be able to create a support ticket to Atlassian to see if they have ideas: https://support.atlassian.com/contact/#/

If you learn anything from them that helps please consider posting the information back here so the rest of the community can benefit.  Thanks!

Sergio Montávez June 17, 2021

Hi again @Bill Sheboy 

I submitted a ticket to their support team at the same time that I posted this topic. Conversations are already going but there's no conclusion yet. Once I have anything final I'll post it here.

Thank you for being involved!

Like Bill Sheboy likes this
Sergio Montávez July 6, 2021

Hi @Bill Sheboy 

Just posted the answer :)

Suggest an answer

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

Atlassian Community Events