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
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events