how do I set a default value for a field? eg "Due Date"

We'd like to set the default value for Due Date (if not specified) to one that's one week from the day it was entered. What's the best way to accomplish this? I've seen discussion of using javascript in the description field:

Is this the best way to accomplish it? The above link is 5 years old...

We're running Jira 4.4. Thanks!

2 answers

1 accepted

3 votes
Accepted answer

if you would like this value to be auto-inserted before you even submit the new issue (i.e. on issue creation screen) than I think that playing with javascript hacking will be the way to go (although the most fragile - as JIRA UI rapidly changes).

If you are happy with due date set immediately after the issue is created I would write a simpe post workflow action and attach it to the initial (create) transition of the workflow. You have to make sure that the place for such post workflow action is correct (ideally just after "Creates the issue originally." built-in Post Function. As it's executed on the server side you can do various stuff there easily (like set this date depending on various circumstances - issue type, SLA, priority, etc.) and that will be less fragile as server-side API changes slower than UI.

JIRA Behaviours Plugin also may help you - although I haven't seen there the exact functionality you want, it's easy extensible with Groovy scripts (no compilation required).

yes, you might still do this and I'm doing this still in Jira 6. e.g. for the description field, you might use AJS code like this for your field description:

<a href="#" onclick="AJS.$('#description')[0].value='FIELD DEFAULT TEXT'; return false;"><b>click here to set default text</b></a><br/>

you might also change your JIRA Template if you're firm with customizing your env:

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,098 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you