Forums

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

Auto Fill summary at Create based on issue type

Jeremy Cejka
Contributor
October 20, 2022

I need to pre-populate/auto fill the Summary field based on issue type. 

 

Ive tried to create a custom field that has pre-populated text, and that gets assigned to a specific screen based on the specified issue type, and the use either a post function jsu script or the built in copy field to field option but I cant get past the validators for summary being empty.

Also appears JSU Behaviors wont work either because Summary isnt a field I can configure for behaviors. 

Summary is a required field, but surely their has to be away for customization where we can either pre-populate this field based on criteria or make it not required using scripting such that we are trying to populate it based on custom field input. 

Using JIRA Server on prem. 

 

2 answers

1 vote
Cloudites Owner
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 20, 2022
0 votes
Rafael Costa
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 20, 2022

Hi, @Jeremy Cejka 

I do it with javascript.

You would need check if HTML is enabled to field descriptions in Administration > General Configuration > Enable HTML in field descriptions and list item values

After enabled, go to issue type's field configuration and edit the description from Summary Field with this script:

 

<script>
createScreen
= document.querySelector('[name="jiraform"]')
if (createScreen){
summary = createScreen.querySelector('[id="summary"]')
summary.value = "YOUR TITLE"
}
</script>
When I set an autofill to a field, usually I hide this field, once it already was filled and the user doesn't need (or You don't want) that this field to be changed. It would look like this:

 

<script>
createScreen
= document.querySelector('[name="jiraform"]')
if (createScreen){
summary = createScreen.querySelector('[id="summary"]')
summary.value = "YOUR TITLE"
summary.parentElement.hidden = true

}
</script>
Jeremy Cejka
Contributor
October 20, 2022

I had tried it but it was working, but then i came across this " you have to Enable HTML in custom field descriptions and list item values

 

I thought it was already done because in years past this process was originally configured in another project/issue type.  Turns out some where along the update path from years ago to now, this setting was disabled. 

turned it on and my script in the field description worked.  Before stumbling upon "you have to enable ..." I just assumed it was another atlassian'ism where they took that feature away. 

Jeremy Cejka
Contributor
October 20, 2022

Kind of like when they took sub issue types.  

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.20.11
TAGS
AUG Leaders

Atlassian Community Events