How do I create a default entry for the description field specific to a project?

This worked in JIRA 4.1.1, but not after upgrading to JIRA 5.2.10. In 4.1.1, I would go to the field configuration of a specific project. Within it, I would go to the Description field, click on edit, and type my java script. Then, whenever a new issue is created in this specific project, a default text would appear within the description box.

However, this is no longer working in JIRA 5.2.10. Any suggestions? Keep in mind, I want the description field to be populated with default text only for a particular project, not all projects. Thanks.

4 answers

1 accepted

He need it in the specific project so it need to be in the field configuration of all the issue type wanted for that project, its easier that way.

yes i know that, we need to add condition, that can be done!!

Hello, in your specific field configuration just put this and it will work with jira 5.2

<script type="text/javascript">

AJS.$("#description").val("default value");

</script>

Thanks. This works exactly like I need it to.

Hi, this sounds like something I need too.

I have JIRA 6.4.12. 

I don't understand what to do with that piece of code. Can you help me?

try with this script by adding it in announcement banner for testing purpose

<script type="text/javascript">
function addDefaultValue() {
//need to add condition here
AJS.$("#description").val("default value"); } (function($) { AJS.toInit(function(){ // init on load addDefaultValue() }); JIRA.bind(JIRA.Events.NEW_CONTENT_ADDED, function (e, context) { // init on refresh addDefaultValue() }); })(AJS.$); </script>

i suggest to load it as webresource module in plugin, check this

https://answers.atlassian.com/questions/47843/strange-javascript-problem-in-create-screen

Hi guys,

There is Default Values plugin available for JIRA. It allows to define default value for description and number of other fields (per project and issue type): 

https://marketplace.atlassian.com/plugins/com.gebsun.plugins.jira.defaultvalues

Regards,

Gebsun

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

773 views 2 19
Join discussion

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