Automation for JIRA to clear a field value

Andrew Tran December 12, 2019

Please help to create an automation that clears a fields value using Automation for JIRA.

4 answers

2 votes
Michael Spoonauer March 14, 2021

I found that, if you are doing an automation rule where the trigger is the changing of the value of a field, leaving date fields blank to clear them does not work.

Instead, I have to use {{clear}} trick:

Solved: How to use automation to clear date value on chang... (atlassian.com)

Thanks,
Mike

Johnny Hermann December 27, 2021

Hi Mike,  What "{{clear}} trick"?  The given link provides no details.

I need to clear custom date fields "Target start" and "Target end" (created by Advanced Roadmaps), which are not visible in the field dropdown, hence must use the Additional Fields section.

Like Michael Peal likes this
Johnny Hermann December 27, 2021

Actually, after some trial and error, this appears to work:

{
    "fields": {
        "Target start": null
    }
}

Like # people like this
Kelly Lillis February 15, 2022

This just really helped me! Thank you! I used it to automatically remove a flag when changing the status from blocked to any other status. 

 

{
    "fields": {
        "Flagged": null
    }
}

Like # people like this
Lily Tucker-Ha September 22, 2022

Thank you @Michael Spoonauer for the {{clear}} tip. 

I used it on a custom field and it worked:
Clear Field Automation.PNG

Like Eric Bergeron likes this
Michael Peal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 26, 2022

Thanks for sharing. This solved an issue I had removing the Due Date values.

Eric Bergeron January 31, 2023

Thank you @Lily Tucker-Ha who's solution was particularly quick and simple. 

Like Lily Tucker-Ha likes this
1 vote
Johan Soetens _Dumblefy_
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.
December 12, 2019

Hi Andrew,

I don't know your full use case but note that there are out-of-the-box Jira workflow post functions that can clear a field.

https://confluence.atlassian.com/adminjiracloud/advanced-workflow-configuration-776636620.html#Advancedworkflowconfiguration-postfunctions

0 votes
Deleted user December 13, 2019

Hey Andrew, 

Thanks for reaching us. I'm from Automation for Jira team :)

It seems that you're trying to clean the custom field Baseline end date, right?

So, can you try to remove the additional field configuration?  

 

edit field.png

Then, you'll need to keep this field empty, and with this configuration, your field will be empty.

1c2ee3f7-e622-4369-968f-31c0cfb5c410.pngCan you give a try and let me know how it goes?

Have a nice day!

Cheers, 

Chris

Martin H_ Sluka
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 20, 2020

Hi Chris,

I stumbled upon this issue, because I have the same use case:

grafik.png

Unfortunately, the solution you suggest does not work for me:

grafik.pngBut the field is of course available for this issue; the issue got selected only because it has this field set.

Any ideas on how to solve this?

Kind regards
Martin

Martin H_ Sluka
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 20, 2020

Turns out: The problem in my case was that the Actor did not have "Edit issue" permission. :)

Now that I've given it this permission, I can confirm that your suggestion works.

Regards
Martin

Like Dave Liao likes this
Konrad McClure SW
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 30, 2020

Is it possible to do this for the Resolution Field? I'm trying to clear it when reopening an issue but all of the suggestions I can find don't appear to work:

Screenshot 2020-11-30 121324.pngScreenshot 2020-11-30 121350.png

0 votes
Andrew Tran December 12, 2019

Snag_35287e0c.png

Andrew Tran December 12, 2019

This is currently what i have but it does not work.

Ajinkya Paradkar September 13, 2022

Hi @[deleted]  , 

 

I am facing a strange issue with the automation rule.

When I use the automation for only one custom field , it works all fine.(PFA)

image.pngBut when I use it for multiple custom fields it fails.

Any idea what could be missing here.

 

Thanks,
Ajinkya

Suggest an answer

Log in or Sign up to answer