Forums

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

Set issue summary in post-function on create

Jennifer H.
Contributor
April 14, 2014

Hi all,

I've written a groovy script that populates the summary w/ a few custom fields on create. The script runs as a post-function before the issue is created, i.e.

  1. Script /home/jira/scripts/test.groovy will be run.
  2. Creates the issue originally.
  3. Re-index an issue to keep indexes in sync with the database.
  4. Fire aIssue Createdevent that can be processed by the listeners.

The script works but it won't let me create the issue without first entering something in the summary since it's a required field. Is there any way around this?

Thanks!

2 answers

1 accepted

0 votes
Answer accepted
Nic Brough -Adaptavist-
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.
April 14, 2014

No. The summary is checked as being mandatory before your script gets a chance to execute.

The closest you can get is a javascript hack that dumps some default text into it so the user doesn't have to type a dummy value in.

Jennifer H.
Contributor
April 14, 2014

Thanks. :) I thought so..

I tried the js hack but the problem with that is it overwrites the summary on edit. :/

0 votes
Paresh Gandhi
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.
April 15, 2014

this may help:

<script type="text/javascript">
if (document.getElementById("summary").value == "") {
document.getElementById("summary").value = "Some Information:\n";
}
</script>

JBennett
Contributor
June 12, 2018

Hi I'm goinf to try this but where would I past the javascript. thanks 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events