Forums

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

Automation action to clear custom field value using advanced json editing

Patrick Davis
Contributor
May 15, 2023

Hello there.  I'm writing an automation rule that attempts to unset the value of "Parent Link" on an Epic based on the status of the parent.  All of the conditional logic for this works fine - I'm having a problem with actually unsetting/clearing the value of the field.

This was working just fine a few weeks ago - without making any config changes it has stopped working, so if the deprecation changes around parent, parent link, and epic link were finally made I'd like to know more about them.  I've tried modifying the "parent" field as well but have the same issue as below.

I've tried multiple ways of setting the field value to null or empty. The audit log response I'm now getting is "Could not find issue by id or key. (parent)". Isn't there a dirt-simple way to clear a value from a field?  Feel like I'm missing something obvious.

 

```

{"fields": {"Parent Link":{"value": null}}}

{"fields": {"Parent Link": null}} //this used to work until recently, now gives the error above
{"fields": {"Parent Link": ""}}
{"update": { "Parent Link" : { "set": {"value": null}}}} //parser seems to complain about invalid operations names

```

If you've navigated this in the last few weeks I'd love to learn what needs to change in the approach. Pulling from the documentation on advanced editing doesn't seem to provide much insight here.

2 answers

1 accepted

4 votes
Answer accepted
Karim ABO HASHISH
Community Champion
May 15, 2023

hi @Patrick Davis 

Could you please try the below syntax. i tested it on my side and it worked.

{

    "fields": {

        "parent": null  

    }

}

Let me know how it went for you.

Cheers,

Karim

Patrick Davis
Contributor
May 19, 2023

Interesting, thanks yes that's the right answer here.  Tried this a few weeks ago and it didn't seem to function properly, but it's clearly working now.

Karim ABO HASHISH
Community Champion
May 21, 2023

hi @Patrick Davis 

You are most welcomed. Glad it worked for you.

Cheers,

Karim

David Croenne August 24, 2023

Same for me, looks like Atlassian changed some stuff.

Thank you so much, I've been fighting with this for 1h ;( 

This syntax is working:

        "parent": null  

 

0 votes
Jen Elam
Contributor
May 18, 2023

@Karim ABO HASHISH I tried the above and got error:  Not valid JSON

I am using Cloud version of Jira

Patrick Davis
Contributor
May 19, 2023

the syntax is well-formed. may want to check for any stray commas or other characters

Karim ABO HASHISH
Community Champion
May 21, 2023

hi @Jen Elam 

Could you please provide a screenshot for the configuration to better assist you with the issue.

Cheers,

Karim

Suggest an answer

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

Atlassian Community Events