Forums

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

post function to update custom field of date picker to current date.

Abhi March 19, 2023

Hello,

I want to use a post function to update a custom field "close date" of date type to "CURRENT DATE", when a transition is executed from done status to closed status.

I have attached the list of post functions available.

Screenshot 2023-03-19 153452.png

I can use only the below JWT plugin options , since we do not have script runner or Jmwe.

Thanks in advance

 

3 answers

1 accepted

2 votes
Answer accepted
Vicente Domínguez _Decadis AG_
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.
March 20, 2023

Hello @Abhi.

I am part of the Support Team of Decadis and I will gladly answer your question.

In order to update a Date Picker or a Date Time Picker field with the current date and time, you can use the Update or copy field values post function.

Select within the post function the Date Picker or Date Time Picker custom field of your choice that you need to update and set the value Copy field value from current issue and copy the field Current date and time in the pop-up window.

Update_Date_Picker.png

If you need more information, you can always take a look at our documentation or contact us via our Support Service Desk.

Best regards,

Vicente

Abhi March 20, 2023

Hello @Vicente Domínguez _Decadis AG_ 

Yes this is working as expected I have used date and time logged in a transition.

Thankyou

Have a great day

3 votes
John Funk
Community Champion
March 19, 2023

Hi @Abhi  - Welcome to the Atlassian Community!

I don't have the server version, but in cloud I can choose the Update Issue Field, select a field and then type in a value. It would look like this:

Screenshot.png

Abhi March 19, 2023

Hello @John Funk 

Thankyou for your response.

I can choose update issue field , but i dont have an option to select custom field , Options to select I have is only for system fields.

as below:

Screenshot 2023-03-20 094357.png

John Funk
Community Champion
March 19, 2023

Ah, looks like Server version might not have that available. Is there a Set field option? Can you share all of the post functions that are available to you? 

Abhi March 20, 2023

Hello @John Funk 

Here is the list of post functions

Screenshot 2023-03-20 135244.png

John Funk
Community Champion
March 20, 2023

Strange that Server wouldn't include that. Maybe try the last one on your list? Or 3rd from the bottom? 

Abhi March 20, 2023

Yes I tried @John Funk Thankyou.

Like John Funk likes this
0 votes
Kedar Kanel
Contributor
January 28, 2025

update date field in transition.png

Hi , @John Funk I want the date to be set to current date only if the field is empty. Is there any alternative to writing the post function script for this functionality?

John Funk
Community Champion
January 29, 2025

Hi @Kedar Kanel  - I usually do that with two different transitions - one with a condition that the field is empty and one where it is not empty. Then add you Post function above to the appropriate transition.

Suggest an answer

Log in or Sign up to answer