Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to create a template for issue description? Edited

Hi everyone! 

I try to find out if there are a way to insert a template in the issue description that shows up for everyone when someone wishes to create a new user story. It could be a template where te designteam shoud do something, next part the test team and last one the developer team.

Any ideas? 

 

Jira Skärmklipp.PNG 

7 answers

So, turns out there IS a way to do it without adding any extra steps or changing the (human) workflow in any way.  It's just not very intuitive to come up with - and that's an understatement.  For the record - I didn't come up with it myself - I was given the tip from a new employee that did it in a previous company.  Still, getting it to work took some time.

Since it's anything but obvious, even once you have the idea - I'm sharing this, both to help others and also - documenting it so that if I have to do it again in the future I won't have to spend as much time tinkering with the system...  Note that this is from memory, so there might be small mistakes here and there - but the gist of it is correct.

Here's what you have to do (no doubt getting it to work is cumbersome to - but once it works - it works perfectly and flawlessly):

- Add a new custom field (a reasonable name would be 'Bug Description'), that contains the template you want to use as the default value (see https://confluence.atlassian.com/adminjiracloud/configure-a-custom-field-991923771.html for details).

- Go to the Field Configurations, select your field configuration, search for your new custom field, select Renderers and pick the Wiki-style renderer.

- Make sure you have a dedicated screen for creating issues of type Bug (Bug Creation Screen).  If you don't (by default you don't) - create one - start by simply creating a copy of your existing issue screen.  In that screen - add the new custom field you created in the previous step, and place it near the Description field.  Once we're done we'd want to remove the original description field altogether, but keep it for now as you're still tinkering with setting things up.

- Once that screen is created - create a screen scheme that associates the Create operation with the new Bug Creation Screen, and then, in your Issue Type screen scheme - associate issues of type Bug with that screen scheme.

 

If everything worked so far - then when hitting Create and selecting the issue type Bug, you should see the Bug Description field alongside the Description field.  When switching to another non-Bug issue type, it should disappear.  Works so far?  You're half way through:

- If you don't already have a separate workflow for bugs (which you probably don't) - now's the time to create it.  Just copy your existing workflow, and associate it with the issue type Bug.

- In that workflow - edit the Create transition, and add a Post Function that will copy the value of the Bug Description field into the Description field.  Here too - if you don't already have a separate workflow for bugs This is what it would look like after configured:

"The field Description will take the value from Bug Description. Source and destination issue are the same."

NOTE:  That post function must be the first one in order.  It must appear before the "Creates the issue originally." step, as unintuitive as it might sound.  Otherwise, it just wouldn't do anything (https://confluence.atlassian.com/jirakb/post-function-on-create-issue-transition-appears-to-not-work-718836210.html).

Publish the workflow, and test it.  If everything is configured properly (and assuming I haven't forgotten any steps - it's been quite a journey), then whatever you put in the Bug Description field, would override anything that's in the built-in Description field (upon submission).  I.e., right after submission - if you open the issue - you should see whatever you put in the Bug Description field, appearing in the Description field (the Bug Description field shouldn't be visible when viewing an existing issue).  Given that the built-in Description field is updated, your workflow for viewing, searching - or doing anything else - remains completely unchanged.  This workaround only affects the issue-creation workflow.

If everything is working - you can now go back to the Bug Creation Screen, edit it, find the built-in Description field, and select Remove, as it's no longer relevant during creation of new bugs.

That should be it!

Let me know if anybody manages to pull it off :)

 

Zeev

I just did, it does work flawlessly. My only issue is about having to use markup for formatting the default value. Other than that, it works well and should support a variety of scenarios.

Thank you very much for this guide !

It took 1 hr to configure but then it works like magic. Thanks, this is smart!

Thank you very much, Zeev!

As warned, it took a while to set up but the guide was accurate enough and I managed to achieve the desired result, learning a thing or two about Jira in the process.

Hope you all have a nice day.

Wow!! I managed to get it up and running as well, thank you very much for the extensive guidance!!!

Hi @Zeev Suraski

Thanks so much for your sharing. I have completed the steps in your detailed guidance. It looks good. But I still have two questions left here. Could you please help advise?

1. Publish the workflow, and test it.  If everything is configured properly (and assuming I haven't forgotten any steps - it's been quite a journey), then whatever you put in the Bug Description field, would override anything that's in the built-in Description field (upon submission).  I.e., right after submission - if you open the issue - you should see whatever you put in the Bug Description field, appearing in the Description field (the Bug Description field shouldn't be visible when viewing an existing issue). 

-- After this step, the Bug Description is still showing in my side. Could you please advise did I miss any step?

 

2. For the last step, when I remove the original build-in description from Bug creation screen, the post action "copy value from Bug Description to Description" seems not work any more. In the creation result, it only show the Bug Description but cannot show the original built-in Description.

 

Could you please advise?

 

Thanks so much.

 

Best Regards

Stephanie

Hi @Zeev Suraski ,

Thanks so much for your sharing. I have completed the configuration following your detailed guidance. Basically it works. But I still have two problems. Could you please help check and advice?

1. Publish the workflow, and test it.  If everything is configured properly (and assuming I haven't forgotten any steps - it's been quite a journey), then whatever you put in the Bug Description field, would override anything that's in the built-in Description field (upon submission).  I.e., right after submission - if you open the issue - you should see whatever you put in the Bug Description field, appearing in the Description field (the Bug Description field shouldn't be visible when viewing an existing issue).

-- After this step, both the Bug Description and build-in Description are shown in the page. How could I make the Bug Description invisible in viewing the issue created?

 

2. After the last step to remove the build-in Description field from creation screen, the post action "copy the value from Description to Bug Description" seems not work any more. Finally in the issue created, only show the Bug Description, but cannot show the build-in Description. Not sure where I got wrong?

 

Could you please help advice?

 

Thanks and Best Regards

Stephanie

Hi @Zeev Suraski , can you please help me.

Once I add Bug Description to Bug Creation Screen, Bug Description field automatically appears on all previously created bugs. I've created a screen scheme to associate create operation with Bug creation screen. But it seems like view operation also follows same Bug creation screen.

I want not to change any old bugs (created in the past), and new change with Bug Description field to occur only for newly created items - for all operations: create, view, edit.

Is there a way to do it? Or I misconfigured something?

Maybe not a perfect solution, but we ended up using the "free" Automation tools built into JIRA. So when someone creates an issue, it adds our template details to the issue description and puts the original description into a section of the template. It also applies the labels we need. 

Not perfect in that it requires first creating the issue, then you get the template, but works for us!

Hey Michael- do you have any more info on this? Curious about this implementation.

https://www.atlassian.com/software/jira/features/automation Start here.

Basically, we setup an automation to trigger on Story/Bug creation. Then told it to add the labels we wanted, assign it to a person, add additional text to the description, etc...

The only downside is if you're using the 'Create' modal, you won't see all this until after the story is created. It's most helpful to our users who insert stories using the add feature at the bottom of the backlog. Once you enter the story and hit save, clicking it to open it will show all the automation stuff.

Like Steve Lemire likes this

@Michael Haywood I am using the same solution you describe, however how were you able to "add additional text to the description"? This is the missing part for me.

I appreciate if you can share this information.

example-automation.pngHere is an example of how we did it. {{issue.description}} is what the person typed in when first creating the issue.

Like # people like this

That's exactly what I have in place. Thanks for sharing!

It does add the template upon creation, but if when creating the issue the users adds text in the description field, then the automation does not remove the user entered text (which is good).
I was trying to see if the automation could add the template in addition to leaving what the user entered in the description field. Do you know if that is possible? Thanks again!

I would think the  {{issue.description}} is what would handle that. Wherever we have that inserted into our templates is where the original user-entered description shows up after the automation runs.

I was missing this part: {{issue.description}}

Now that I added it it works as intended. Thanks again for your assistance!

@Michael Haywood Oh my, this is almost perfectly what I currently need!!

Thank you so much for sharing.

3 votes
bitvoodoo nick Community Leader Mar 26, 2019

Hi Ronnie

Out of the box this is not possible in Jira.

There are multiple ways to implement this functionality with apps. @Kumar already explained one way.

You could also use one of these apps:

These are the ones I know. If you search in the Atlassian Marketplace you maybe find a few more.

Cheers
Niklas

Hi @Ronnie Hilmersson   by using the Behaviour Plugin you can a default description 

Admin Settings > Add-ons > Behaviours > Give a name and Add > Right Side choose Fields >

Select Description  and add below Script with Template >  Save it > come out from that

Window > Choose add Mapping in that Select Project and Issue type and save it.

 

def desc = getFieldById("description") 

def defaultValue = """ // ...Start Adding the Default Template       

End Here..""".replaceAll(/    /, '')

 if (!underlyingIssue?.description) {    

desc.setFormValue(defaultValue)

}

 

When you try to create that project Issue it will show you default given template in Description Field .

I hope it Helps.

 

Thanks,

Kumar

Hi Kumar,

 

I tried the above as suggested by you but it didnt set any default text on description field. Any idea where is it going wrong?

Hi @Ronnie Hilmersson ,

You can also try Easy Templates for Jira Issues add-on . Your team will be able to create Jira tickets (even with subtasks) from saved templates like Stories, Bug reports and other processes.

Cheers,

Pavel

Hi!

Thanks everyone! It was exactly what I was looking for! 

Best regards/Ronnie

Which solution did you end up using?

Like # people like this

A simple approach is to create a dummy ticket and clone from that...

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Bitbucket Smart Commits vs. Genius Commits - What's the difference?

If you already heard about Smart Commits in Bitbucket, know that you just stumbled upon something even better (and smarter!): Genius Commits by Better DevOps Automation for Jira Data Center (+ Server...

114 views 0 2
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you