Forums

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

Could some one please help in how to prefill Summary Field before issue has been even created.

Naveen April 26, 2018

Could some one please help in how to prefill Summary Field before issue has been even created. This should happen a particular project but not on all projects.

2 answers

0 votes
Tuncay Senturk
Community Champion
April 26, 2018

You can use  Behaviors for this.

Naveen April 26, 2018

Hello @Tuncay Senturk

It's me again .

I am using below behaviours script

def summary = getFieldById("summary")
        if (! summary.getValue()) {
            summary.setFormValue("abc")
        

It works fine, but when i change the project  the value abc sticks to summary field.

Is there any correction so i can avoid that happening?

I am looking to achieve this only on one project.

Tuncay Senturk
Community Champion
April 26, 2018

I think I could not understand the main point but if you need to add project control you can use following statement

 

def projectKey = issueContext.projectObject.key
if (projectKey.equals("PRJ") {
// ...
}
Naveen April 27, 2018

@Tuncay Senturk

I am sorry i couldn't explain you properly. When i use the code which i pasted above, the summary field gets pre-populated when i am on create form for the project CMR because i have selected the workflow related to CMR project in behaviours to act upon.

But when in the create screen if i change the project value which is using different workflow other than CMR the summary field shows that default value which we set in screenshot1 and also makes the field optional as shown in screenshot2.

Here am looking to implement this only on one project which is CMR. Please suggect me what can be done here to achieve desired functionality.

screenshot1.pngscreenshot2.png

Tuncay Senturk
Community Champion
April 27, 2018

You can restrict the behaviour for the project or use a code as below

issue.getProjectObject().getKey().equals("CMR") && ...

I hope I did not miss anything. 

Naveen May 1, 2018

@Tuncay Senturk

Thanks a lot for all the help.

Tuncay Senturk
Community Champion
May 1, 2018

You're very welcome Naveen

0 votes
Bob Moore
Contributor
April 26, 2018

Hi Naveen,

You can use the Default values plugin for Jira to achieve this.

You can set default values per project or issue type.

More info here >>  https://marketplace.atlassian.com/plugins/com.gebsun.plugins.jira.defaultvalues

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events