Forums

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

Using Post Function to Update a Custom Date Field

Deleted user June 16, 2020

I'm using the %%CURRENT_DATE%% to update a custom date field within a post function in part of my workflow.     Within this workflow/transition - there is a validation and associated screen to validate the correct entry of a different custom field.   Now I want to add a post function to auto fill in a date for another custom field.  This is the error I'm receiving after going through the validation step:

Unable to update custom field customfield_10414 - Actual Release Date in issue [UBS-1].

The custom field is a "date picker"

4 answers

1 accepted

1 vote
Answer accepted
John Funk
Community Champion
June 16, 2020

Hi Karen,

Let me see if I understand all that is going on. 

You have a transition that has two post functions on it to update two different custom date fields to timestamp them with the current date. Correct?

And you have a validator on that same transition that checks to make sure that a custom field has a value (required field validator I assume). Correct?

And you have a transition screen associated with the transition to populate another custom field. Correct?

Is the field in the transition screen also the field being validated? 

Which field is now receiving the error?

Deleted user June 16, 2020

Thanks for responding, to clarify:  On a specific Transition:

- There is one validation to make sure a specific custom field content matches a specific expression

- I added an additional Post Function (there were already ones listed) this action is to update the custom field with the current date.   I thought perhaps it was related tot he order of the post functions and tried also moving it down in order as well (had the same error).  

PostFunction.JPG

John Funk
Community Champion
June 16, 2020

Just a thought - is the Actual Release Date field in context for the project you are using? Sometimes custom fields are added but I forgot to map it to the project and/or issue type that it is now being used for. 

Deleted user June 16, 2020

It's shown with Global context - available for any project and any issue. 

As a workaround, I've removed from post function and added to validation that the field must be complete. 

Just not ideal and wanted to understand if it's a bug or if I have an issue with my configuration.

John Funk
Community Champion
June 16, 2020

Another option is to create an Automation For Jira rule that would do the update for you. It is now free with Jira Cloud.

John Funk
Community Champion
September 15, 2021

Hey Karen - Just following up on this. Did you get it resolved?

Vito Pinto
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!
July 7, 2022

Hello John,

 

I'm picking it up again because I'm having the same issue with post function only

Custom field is Date Picker (e.g. End Date) and I've added a post function in the transition to "successfull" state. I want the field to be updated with the current date

John Funk
Community Champion
July 8, 2022

Hi Vito - Welcome to the Atlassian Community!

I would suggest you open a new question for the Community so that more people will see it and be able to respond. 

1 vote
Nicolás Guzmán
Community Champion
July 19, 2023

Hi, 

I had the same problem and the solution was to use %%CURRENT_DATETIME%% instead of just %%CURRENT_DATE%%.

I hope it works for you too.

1 vote
Peter Mavridis
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!
August 31, 2021

Same problem. Wanting to do a very simple update of a date picker field on a transition using a post function, but getting an error. 

There seem to be a lot of bugs in JIRA Cloud that just are not being addressed. 

I'll wait the normal 10 years before this one is fixed too? 

0 votes
Sudhakara Reddy Aragonda
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!
January 6, 2025

Use below post function to set the Date field with the current date:

 

Update Issue Custom Field

  • Issue Custom Field: Start Date
  • Custom Field Value: %%CURRENT_DATETIME%%

 

 

Steps:

1. Edit the workflow

2. Go to Transition where you want to add the Post Function

3. Click  Post Function, It will take you to the Post Function Section where you can add the post functions

4. Click Add Post Function
5. Select the Update Issue Custom Filed Post Function from the list of Post Functions

6.Click Add

7. Select Date Custom field from the Issue Custom Field

8. Enter the Custom Filed value section with the  %%CURRENT_DATETIME%%

9. Click Done and publish the work and verify.

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