JIRA描述默认值设置

Setting a Default Value in the Description Field

转自https://confluence.atlassian.com/jira/setting-a-default-value-in-the-description-field-166003857.html

(在 6.3.6 版本上验证通过)

The content on this page relates to platforms which are not supported by JIRA. Consequently, Atlassian cannot guarantee providing any support for it. Please be aware that this material is provided for your information only and using it is done so at your own risk.

This page describes how to set a Default Value for the Description field in JIRA. There's a feature request for this at JRA-4812. Please watch and vote on the issue if this is important to you.

There are workarounds to add this functionality. The modification does not persist if you upgrade JIRA so you'll have to re-apply these steps again in the future. Here are directions to set a default value for your Description field in JIRA:

  1. Locate and backup the file: WEB-INF/classes/templates/jira/issue/field/description-edit.vm
  2. Open that file:

1 #controlHeader ($action $field.id $i18n.getText($field.nameKey) $fieldLayoutItem.required $displayParameters.get('noHeader'))

2

3 ## setup some additional parameters

4 $!rendererParams.put("rows", "12")

5 $!rendererParams.put("wrap", "virtual")

6​

7 ## let the renderer display the edit component

8 $rendererDescriptor.getEditVM($!description, $!issue.key, $!fieldLayoutItem.rendererType, $!field.id, $!field.name, $rendererParams, false)

9​

10 #controlFooter ($action $fieldLayoutItem.getFieldDescription() $displayParameters.get('noHeader'))

  1. Add a section like this:

1#if($description == '')

2#set ($description = 'Put stuff here:')

3#end

So, ultimately it should look something like:

1#controlHeader ($action $field.id $i18n.getText($field.nameKey) $fieldLayoutItem.required $displayParameters.get('noHeader'))

2

3## setup some additional parameters

4$!rendererParams.put("rows", "12")

5$!rendererParams.put("wrap", "virtual")

6

7

8#if($description == '')

9#set ($description = 'Put stuff here:')

10#end

11

12## let the renderer display the edit component

13$rendererDescriptor.getEditVM($!description, $!issue.key, $!fieldLayoutItem.rendererType, $!field.id, $!field.name, $rendererParams, false)

14

15#controlFooter ($action $fieldLayoutItem.getFieldDescription() $displayParameters.get('noHeader'))

  1. Restart your JIRA instance.

Adding multi-line values

If you wish to display in the description a default value of:

1Step 1

2

3Step 2

4​

5Step 3

you'll need to tweak the above instructions a bit:

1 #set ($description = "Step 1\

2 \

3 Step 2\

4 \

5 Step 3")

6 #set ($description = $description.replace('\',' '))

OK,修改完成后,到前台创建问题的界面,刷新一下,点击创建,效果有了。

- 实验证明,如将”Step 1…” 替换成输入中文,生效后,界面将会直接显示乱码或者报错,这个。。。该怎么解决这个问题?待研究。如哪位童鞋知道有解决方法,请告之一下,谢谢。

  1. 替换方案

方案吧,也简单,不用中文,直接用英文。。。目前只能使用英文格式暂时先用着,如下:

#if($description == '')

#set ($description = "[Prerequisite]\

1.\

[Step]\

1.\

2.\

3.\

[Actual Result]\

1.\

2.\

3.\

[Expected Result]\

1.\

2.\

3.")

#set ($description = $description.replace('\',' '))

#end

好了,完成,使用没有报错。

JIRA描述默认值设置的更多相关文章

  1. php与js中函数参数的默认值设置

    php函数参数默认值设置: <?phpfunction test($val=3){   echo $val."<br/>";}test(11);test();?& ...

  2. js方法参数默认值设置

    这里的默认值设置 很容易以为和php相似 function(v1,v2="test") { alert(v2); } 但这样是不对的,js方法,如需传参,甚至可以不用预定义(也就是 ...

  3. sqlserver中GUID的默认值设置

    sqlserver中GUID的默认值设置 YID uniqueidentifier not null default (NEWSEQUENTIALID()), //有序GUID(只能用于表设计的时候的 ...

  4. yii2中textarea中的默认值设置

    1. view中显示文本域的位置 <?= $form->field($goods_model, 'goods_introduce')->textArea(['class'=>' ...

  5. asp.net EF model中的默认值设置

    在做数据库规划时,通常会规划一些系统字段,也就是由数据库本身自行指定默认值到这个字段上,创建新的“创建时间(CreateDate)”字段就会常常这样设计. 如果希望能有默认值,且让.net 程序在新增 ...

  6. UEditor富文本WEB编辑器自定义默认值设置方法

    1.在使用UEditor编辑器编写内容时你会发现,当输入的内容较多时,编辑框的边框高度也会自动增加,若希望输入内容较多时以拉框滚动的效果. 方法:找到Ueditor文件根目录下的ueditor.con ...

  7. 【第十五章】 springboot + pojo默认值设置

    我们有时需要给POJO设置默认值 pojo设置(推荐) 1.User package com.xxx.firstboot.domain; import lombok.Getter; import lo ...

  8. 第十五章 springboot + pojo默认值设置

    我们有时需要给POJO设置默认值 pojo设置(推荐) 1.User package com.xxx.firstboot.domain; import lombok.Getter; import lo ...

  9. C#属性默认值设置

    关于在MVC中view中设置默认值,可以象如下设置: 1.关于VIEWMODEL的部分 如果是C#  6.0,网上资料查到说可以 如果语法不支持,只能改回.net 2.0的写法. public cla ...

随机推荐

  1. HDU 5569 matrix

    简单DP /* *********************************************** Author :Zhou Zhentao Email :774388357@qq.com ...

  2. php运行机制初探

    对于这个结果我也很吃惊,但是事实就在眼前,没办法啊,那么到底为什么会有这样的效果呢,咱们继续一探究竟: *.php(php代码) -----Scanner(zend引擎逐行扫描变为zend可以识别的语 ...

  3. 如何删除要素类 IFeatureWorkspace 接口介绍(1)

    如何删除要素类 要想删除一个要素类,那么必须先得到这个,在得到这个要素类的时候,我们要学习一个新的接口IFeatureWorkspace. IFeatureWorkspace  接口介绍 这个接口主要 ...

  4. Paragraph 对象'代表所选内容、范围或文档中的一个段落。Paragraph 对象是 Paragraphs 集合的一个成员。Paragraphs 集合包含所选内容、范围或文档中的所有段落。

    Paragraph 对象'代表所选内容.范围或文档中的一个段落.Paragraph 对象是 Paragraphs 集合的一个成员.Paragraphs 集合包含所选内容.范围或文档中的所有段落. 方法 ...

  5. acm--统计错误数

    题目描述 题目地址:http://www.nowcoder.com/practice/67df1d7889cf4c529576383c2e647c48?tpId=49&tqId=29276&a ...

  6. libthread_db

    http://timetobleed.com/notes-about-an-odd-esoteric-yet-incredibly-useful-library-libthread_db/

  7. Horizon/DomainWorkFlow

    https://wiki.openstack.org/wiki/Horizon/DomainWorkFlow

  8. 关于OC和Swift使用GIT创建项目

    1.先进入码云,点击自己的头像 ->   ,2.里面有一个SSH公钥,点击   ,3.之后在终端输入 ssh-keygen -t rsa -C “xxxxx@xxx.com”,注意:”” 要用英 ...

  9. Handler和Message以及Looper之间的三角关系

    说到Handler想必大家都经常用到,在非UI线程更新UI那可是利器,用起来也非常容易上手 从使用上来说,我们只需要关注sendMessage和handleMessage即可 所以我们先从Handle ...

  10. mysql 查找重复的数据

    Select Name,Count(*) From A Group By Name Having Count(*) > 1   Name是字段