Forums

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

Scripted default value in creation screen

Ireen Klein_Actonic
Contributor
July 29, 2018

We use a custom field "Due Date". When an issue is created a default value should be set. It should be the current Date + 7d.

I have no programming skills, but we use scriptrunner. Somebody an idea?

Thank you very much for your advice!

1 answer

0 votes
Tansu Akdeniz
Community Champion
July 30, 2018

Hi @Ireen Klein_Actonic,

Follow the steps below;

  • Go to the related Workflow -> Create Transition -> Post-functions
  • Add new postfunction -> Script Runner postfunction -> Custom script
  • Paste the code 
import java.sql.Timestamp
issue.setDueDate(new Timestamp((new Date() + 7).time))
Ireen Klein_Actonic
Contributor
August 2, 2018

It should already be visible when the create issue screen is seen.

Ireen Klein_Actonic
Contributor
August 5, 2018

Hi, 

I solved it now with Live Fields and the following script:

string Date=currentDate()+"7d";
if(argv["screen"]=="create") {
lfSet("Due Date",Date);
}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events