官术网_书友最值得收藏!

How to do it...

Once you have installed the ScriptRunner for Jira add-on, we will first need to create what is known as a behavior:

  1. Log into Jira with a user that has a Jira administrator's permission.
  2. Navigate to Administration > Manage apps > Behaviors.
  3. Create a new behavior by entering a name for it and clicking the Add button.

With the new behavior created, we need to first create a mapping, so Jira will know what to apply the behavior to:

  1. Click on the Add Mapping link of the new behavior we have created.
  2. Select All projects and Bug issue type for our mapping.
  3. Click the Add Mapping button to save the setting.

With the mapping created, we can now start setting default values:

  1. Click on the Fields link of the new behavior we have created.
  2. Click on the Create initialiser link:

  1. Enter the following code into the text editor:
1.     def desc = getFieldById("description")
2. def defaultValue = ""
3. h2. Describe the problem
4. Tell us in details what the problem you are having.
5.
6. h2. How to reproduce
7. List out the steps to reproduce the problem.
8. * step 1
9. * step 2
10.
11. h2. Expected Result
12. Tell us what you think the correct outcome should be after completing the steps 13. listed above.
14.
15. h2. Actual Result
16. Tell us what you actually see after completing the steps listed above."""
17.
18. if (!underlyingIssue?.description) {
19. desc.setFormValue(defaultValue)
20. }
  1. Click on Save to save our changes.

Now, if you try to create a new Bug issue, you should see the Description field pre-populated with our default value, as shown here:

We will now go have a look at how the steps work.

主站蜘蛛池模板: 石台县| 吉木乃县| 西安市| 湘乡市| 安乡县| 九寨沟县| 湄潭县| 华安县| 巴中市| 昌乐县| 溧水县| 藁城市| 南乐县| 太保市| 郴州市| 大兴区| 泾源县| 荆门市| 新巴尔虎右旗| 东港市| 普格县| 怀宁县| 阳春市| 安平县| 万州区| 通榆县| 焦作市| 高安市| 保定市| 闸北区| 梁山县| 富蕴县| 河曲县| 荆州市| 甘孜| 乐亭县| 北票市| 富裕县| 蚌埠市| 阜宁县| 乐清市|