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

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.

主站蜘蛛池模板: 深水埗区| 竹溪县| 色达县| 那曲县| 永和县| 延边| 察哈| 永川市| 泰和县| 武陟县| 沭阳县| 谢通门县| 湘潭市| 秦皇岛市| 苍梧县| 襄垣县| 衡东县| 海丰县| 依兰县| 易门县| 屯门区| 扎兰屯市| 台南县| 海城市| 朝阳区| 璧山县| 邵东县| 灌云县| 白山市| 色达县| 来凤县| 太谷县| 永泰县| 荔波县| 兰溪市| 绵阳市| 金华市| 旬阳县| 汶上县| 安康市| 兴安盟|