• Community
  • Products
  • Jira Software
  • Questions
  • For Issue type = Bug, when we perfume close action I would like to populate two additional text fields so that root cause and preventive action are filled before closure of any live bugs. Can someone help me with steps? Thank You!

For Issue type = Bug, when we perfume close action I would like to populate two additional text fields so that root cause and preventive action are filled before closure of any live bugs. Can someone help me with steps? Thank You!

Anizkhan Kaleelrahman July 30, 2015

For Issue type = Bug, when we perfume close action I would like to populate two additional text  fields so that root cause and preventive action are filled before closure of any live bugs.

Can someone help me with steps? Thank You!

9 answers

1 accepted

1 vote
Answer accepted
Alexandra Topoloaga
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.
August 14, 2015

You are not on "edit mode". You will need to click "Create draft" (see the yellow band from the top of the picture 2). At the end, after saving the postfunction, you will need to publish the draft. Sorry I've missed it smile

1 vote
Alexandra Topoloaga
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.
July 31, 2015

Hello,

This is a thing you can do very easy using JJUPIN plugin. All you need to do is to add a postfunction on the desired transition in which you populate the fields like this: 

customfield_x = "value1";
customfield_y = "value2";

The documentation of JJUPIN can be found here and more examples of post functions are here.

Hope this helps,
Alexandra 

0 votes
Alexandra Topoloaga
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.
August 21, 2015

Well, you will need to use the ids of the custom fields you want to set. I used 10001, 10002 and 10003 as an example. In order to get the ids of your custom fields, go to "Custom fields" page, find the custom field you want and click "Edit". The id will appear on the address bar: 
image2015-8-21 14:4:14.png image2015-8-21 14:6:13.png

 

In the example above, 10500 is the id of the custom field, so I would need to use customfield_10500.

Also, I guess that the value you want to set is not "value1", please update this as well. smile

Alexandra

0 votes
Anizkhan Kaleelrahman August 20, 2015

Thank you @Alexandra Topoloaga, i can edit now, this is very helpful,

However after pasting your code, and clicking check "It throws following error", is it still fine to publish the below code?

if (issueType == "Bug") {
customfield_10001 = "value1";
customfield_10002 = "value1";
customfield_10003 = "value1";
}

 

image2015-8-21 17:38:17.png

0 votes
Anizkhan Kaleelrahman August 14, 2015

Awesome!

Thank you for the clear steps, I am trying the steps, however on the step 2 my "Add post function" is disabled, do you know how to enable it?

1)

image2015-8-14 18:36:57.png

 

 

2) 

image2015-8-14 18:38:30.png

 

0 votes
Alexandra Topoloaga
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.
August 13, 2015

You are on the wrong screen. At the moment, for your request, you do not need to configure JJUPIN (anyway, the default configuration is all right). All you have to do is to upload JJUPIN into your add-ons and add the postfunction from the workflow screen on the transition wanted. Please notice that you can close an issue from many states (you can go directly from open to closed, from in progress to closed etc).
All you should do is explained, step by step, in the pictures below: 

1.image2015-8-14 10:54:30.png

2. image2015-8-14 10:56:20.png

 

3.image2015-8-14 10:56:42.png

4.image2015-8-14 10:57:33.png

Now, when the transition is triggered, the fields will get populated.

I hope it is clear now smile
Alexandra 

0 votes
Anizkhan Kaleelrahman August 13, 2015

I am trying to configure JJUPIN plug in, however it is asking for following info, where i can find it?

Kepler parameters for the JJUPIN plugin
Configuration values for plugin : jjupin

Default Program Name
Default comment
Default filename
Default directory
SIL Web Service enabled?
SIL Web Service Run As

Also i couldnt see "(k) SIL Post-function"; i see only emails, sil.aliases, sil.properties like below screen.

Sorry for such basic questions, this is the first time i am trying to install a Plugin.

 

image2015-8-14 15:49:59.png

0 votes
Alexandra Topoloaga
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.
August 13, 2015

Hi Anizkhan,

I am glad you found my answer helpful. 
First, you have to create a postfunction on the "Close issue" transition. You can do this by editing the workflow. You will have to choose "(k) SIL Post-function" and put the script you need there. The script should look like this: 

if (issueType == "Bug") {
	customfield_a = "value1";	
	customfield_b = "value2";
	customfield_c = "value3";
}

Click add, publish the workflow and that's all. smile

0 votes
Anizkhan Kaleelrahman August 13, 2015

@Alexandra Topoloaga 

Thanks a lot for your reply, I just bought JJUPIN, could you please help me with step by step procedure to do it.

I need to populate 3 text fields (mandatory) when Type is “Bug” and action selected for transition = close.

Please help me with the steps.

Suggest an answer

Log in or Sign up to answer