Forums

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

Scriptrunner Post Function Set Custom Date Field Once

Sharon Connell
Contributor
July 20, 2018

Hi,

I am not a developer but I pretend to be when using Scriptrunner. I need to set a custom date but then not overwrite it if the issue moves through the transition again. Capture the current timestamp and then not overwrite. I was able to use the following but it sets the start date as the day before.

issueInput.fields.customfield_10703 = new Date().format("yyyy-MM-dd")

Any assistance is much appreciated.

Regards,

Sharon

1 answer

1 accepted

0 votes
Answer accepted
Fazila Ashraf
Community Champion
July 20, 2018

Hi @Sharon Connell

I would create 2 transitions which is same except the data field update and an extra space in the name of one.

Then would apply different conditions on both the transitions.

One transition will be visible when that customfield10703 is empty and the other transition will be visible with the field is not empty.

In the cf10703 empty transition, i will set the value.

 

See whether this instructions suit your requirement as well.

Sharon Connell
Contributor
July 23, 2018

Hi @Fazila Ashraf,

Your solution was elegant and simple. Thank you for steering me in the right direction.

Regards,

Sharon

Fazila Ashraf
Community Champion
July 24, 2018

Happy to help! :)

Suggest an answer

Log in or Sign up to answer