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

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.

主站蜘蛛池模板: 兴城市| 赫章县| 庄浪县| 永登县| 收藏| 丰城市| 兴文县| 神池县| 新干县| 木里| 吉林市| 新乐市| 怀宁县| 中阳县| 宁河县| 三门县| 中卫市| 突泉县| 长宁县| 新密市| 肥城市| 梓潼县| 洛南县| 尉犁县| 永登县| 元阳县| 灵山县| 洛阳市| 辽宁省| 收藏| 拉萨市| 吐鲁番市| 云梦县| 临潭县| 天台县| 湾仔区| 云梦县| 子洲县| 安平县| 琼海市| 三原县|