Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Can I condition the automation rule to update custom field only if it was previously empty?


Hi, all,


I need to have a custom field that will reflect the first time a specific transition occurred.

First I thought I would do it with a post-change action and copy value from Updated to my custom field (Closed Initial Report).

But this does not work in cases when the issue is reopened, and will eventually go through the same transition again, so the initial value will be overwritten, which we do not want.


I thought I may have more options in an automation rule, and I have managed to create a rule that will populate the custom filed with the current time when the transition occurs, but I would also like to add the condition to only populate if this field was previously empty.


However, when I select the Issue Fields Condition and try to select my custom field (so that the action would only be performed if the field is empty) I cannot find my custom field in the picker.


Anyone have any ideas, or an alternative solution?


thank you


3 answers

1 accepted

0 votes
Answer accepted
John Funk Community Leader Mar 03, 2021

Hi Dora,

The best thing would be to figure out why the field is not showing up in your list. If the field was recently added, try refreshing your Automation Rules list, and then go back in to do the edit. 

Second is to make sure the field is on the Create/Edit screen and is available. 

Third, check the context for the custom field to see if it matches with the Project you are working with. 

Finally, what type of field is it? What type of project is it on? 

Hi, John,

thank you for the suggestions.

I refreshed everything several times so I'm guessing that's not the issue.

The field is not on the create screen because only the system will populate it, at a later transition, and it is not on the edit screen because users must not edit it, so I added it only to the View screen.

Just to make sure, I tried adding it to all three screens, but still it is not in the picker.

The field has a global context, but I tried to make it specific to my project, and again no luck unfortunately.


The strange thing is that I just noticed that the solution with JQL "Closed Initial Report" is Empty works on our Server instance, but not in Cloud.


In both instances the field is not available in the picker.




John Funk Community Leader Mar 03, 2021

What type of Field? And what type of Project?

It is a Date Time Picker. Project is classic software.

John Funk Community Leader Mar 04, 2021

And you can include the field in a filter and see the results? 

And are you looking to update the field as a part of the Edit issue action?

John Funk Community Leader Mar 05, 2021

Can you include a screenshot of your rule?


Sure. Here it is with the JQL, because the Issue fields condition would not find my custom field.

The validation of this jql works in the server instance, but in cloud no issues match the jql.


John Funk Community Leader Mar 05, 2021

Maybe try this in the More options section for JSON

    "fields": {
        "customfield_10003": "the value I want to set",

I don't see the More options in any of the condition components, only in the Edit action component.

But if I add it to the action, wouldn't it have effect only on the value that will be set, and not on the condition in which it will or will not be set?

John Funk Community Leader Mar 08, 2021

Use the Advanced Compare option. There you can add in "code".

I tried this option, but none of the issues match the condition again.



John Funk Community Leader Mar 08, 2021

Are you sure there are issues on that project that are in the Implementation status and the custom field is empty after you updated the rule? Remember that you are firing the rule on a transition. so to test you would need to fire it with a new transition to that status. 

I definitely have some issue with this "is Empty" syntax, but not sure why.


There are issues in that status. On some the field is empty, and on some it is not, but the JQL says there are none where it is empty.





John Funk Community Leader Mar 08, 2021

That makes no sense whatsoever. You need to submit a support ticket with Atlassian and show them that.

Please post back here once you have a solution. Thanks!

Will do.

Thank you so much for your suggestions.




John Funk Community Leader Mar 08, 2021

Sorry I couldn't have been more help, but something strange is going on there. :-)


There is definitely a recent issue with "IS EMPTY" and text fields, and I wonder if this issue impacts other field types as well.  The apparent cause is once a field has been set and then cleared, a distinction is made between BLANK and EMPTY in JQL and the API.

You may watch the progress of the fix for this issue here:

The work-around I have been using for this is to check field length of zero in addition to EMPTY.  For a non-text field, you could try converting to text first and then checking length.

Best regards,


Like John Funk likes this

Thank you, Bill, I'll check out the related issues.

In my case the field is a date field, and it is never cleared, but it could be something related, as there doesn't seem to be a logical reason why the system doesn't recognize the fields as empty.



Like # people like this

@Dora Lukin for a date field work-around, you could try this:

advanced compare condition for {{issue.myDateFieldName|0}} equals 0

What that will do is substitute a default of zero (0) when the field is blank or empty, and then test for zero.


Like John Funk likes this

Thanks @Bill Sheboy this has worked for me 

Like # people like this

Yes, I can filter by this field without problems, and I see it on the View screen.


I did some testing with other custom fields and it seems none of the date pickers are available in the automation rule field picker.


Is this a known issue perhaps?


And yes, I would update the field as part of the Edit issue action.


thank you


Daniel Ebers Community Leader Mar 07, 2021

Yes, I experienced the same - date fields are not available in the selection.
I instead went with a JQL approach. If I understood your screenshot right the same like you did.
When needing to set such a field doing it via "More options" / JSON worked, like John said above.

As far as JSON goes, I don't actually have any issues in the edit action, as the date field is available in the action component, but unfortunately not in the condition component.

So I can edit the field, but not with a condition.

The JQL "Closed Initial Report" is Empty works for me in the server instance, but not in cloud.

For some reason in cloud the validation for "Closed Initial Report" is Empty says there are no issues that match the search, even though when the same is entered in the filter search, there are issues that match it.

I also tried to add a condition to check if issue matches JQL:

"Closed Initial Report" is Empty


But even in cases when "Closed Initial Report" is not empty the automation will update the field with the new value.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

454 views 19 23
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