how to set null value for a custom date field using automation?

radhika
Contributor
February 5, 2024

I want to run an automation that set null value to date field while the tickets get closed.

if the smart values {{null}} works.

I tried it doesn't seem to work?

 

2 answers

2 votes
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.
February 5, 2024

Hi @radhika 

Can you select your field from the dropdown list in the Issue Edit action?  If so, try leaving the field empty to clear the value.

If not available in the list and using advanced edit with JSON, try setting the value to null.

Kind regards,
Bill

Matthias Rickheit
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!
May 29, 2024

Thanks Bill, this however doesn't work for me. 

my JSON-line looks like this:

...

   "actual end": null

...

and the automation runs with "success" but the resulting value is the current date and time rather than an empty or null value.

What am I doing wrong? Do I need some escaping or wrapping "null" with anything? 

Thanks for any help! 

(I'm using Jira Cloud)

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.
May 29, 2024

Hi @Matthias Rickheit -- Welcome to the Atlassian Community!

Without seeing your entire rule, let's assume some things:

  • this is a date picker, custom field created in the global site settings
  • you are doing this with a company-managed project

 

Any of these three methods will work for such fields with the Edit Issue action:

  • select the field from the dropdown list, and leave the value empty
  • do not select the field from the dropdown list, instead using advanced edit with JSON use the custom field name
{
"fields": {
"Marketing Date": null
}
}
  • do not select the field from the dropdown list, instead using advanced edit with JSON use the custom field id
{
"fields": {
"customfield_10125": null
}
}

 

If those do not work, please confirm your smart value is correct for the field using this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/

 

Kind regards,
Bill

Matthias Rickheit
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!
May 30, 2024

Thanks very much for the quick and precise answer!

The documantation link you provided also proved very helpful. I really appreciate that. 

All three methods work just fine technically providing a "SUCCESS" status of the automation I'm running.

However, the "Actual end" date being set is in all cases the current date-time of the run itself. 

To give some context: I'm runing this automation to clone an issue that is to be repeated next year. So I need to ...

  • reset some other fields (which works fine) and
  • modify the "due date" to next year (also works fine with "{{issue.duedate.plusYears(1)}}")
  • reset the "Actual end" date preferably to null (this ist the part that I canot seem to get right except when I set some explicit date like "1970-01-01T00:00:01.0")

 

So I have a workaround for now and yet it would be a lot nicer if I could actually get an empty field there instead of "1970-01-01T00:00:01.0". 

 

Thanks again - best regards,

Matthias

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.
May 30, 2024

Thanks for that additional information, Matthias.  For some follow-up questions...

What is the type of your field: date picker, date / time picker, something else?

Is that a custom field you added, or is it from a marketplace addon / app?

Please post an image of your complete automation rule, an image of the clone issue action, and an image of the audit log details showing the rule execution.  Those may provide context to help explain this symptom.

Thanks!

1 vote
Rebekka Heilmann _viadee_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 5, 2024

Hi @radhika 

try setting it to {{clear}} . There was a similar thread suggesting that recently, but I couldn't find it just now.

Suggest an answer

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

Atlassian Community Events