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. mysql查询数据库约束

    SELECT * FROM information_schema.`TABLE_CONSTRAINTS` where TABLE_SCHEMA='mold' and TABLE_NAME='tplmi ...

  2. hihoCoder 1257 Snake Carpet(很简单的构造方法)

    2015 ACM / ICPC 北京现场赛 I 题 构造 注意一个小坑,每条蛇的输出是要从头到尾输出的. 还要注意的是,不能开数组去模拟构造过程,然后输出,那样会TLE的. #include < ...

  3. Python3基础 定义无参数无返回值函数 调用会输出hello world的函数

    镇场诗: 诚听如来语,顿舍世间名与利.愿做地藏徒,广演是经阎浮提. 愿尽吾所学,成就一良心博客.愿诸后来人,重现智慧清净体.-------------------------------------- ...

  4. mysql优化---优化sql

    一.通过show status和应用特点了解各种SQL的执行频率 通过SHOW STATUS可以提供服务器状态信息,也可以使用mysqladmin extended-status命令获得.SHOW S ...

  5. JS基础知识——缓动动画

    基于距离的缓动动画 原理:设定起始位置  start 和终止位置 end,变化会越来越慢. 公式:start=start+(end-start)/10;     这个10不是固定的,想分成多少份就分成 ...

  6. [转] WebService开发笔记 1 -- 利用cxf开发WebService竟然如此简单

    以下文章来自   http://www.blogjava.net/jacally/articles/186655.html 现在的项目中需要用到SOA概念的地方越来越多,最近我接手的一个项目中就提出了 ...

  7. POJ 2653 Pick-up sticks

    计算几何,判断线段相交 注意题目中的一句话:You may assume that there are no more than 1000 top sticks. 我认为是没有描述清楚的,如果不是每次 ...

  8. OC与Swift创建pod

    Cocoa pods 是iOS最常用的类库管理工具   OC的使用   删除源   sudo gem sources -r https://rubygems.org/ 添加源(使用淘宝的镜像,记住要用 ...

  9. 物理机(真实机)能ping通虚拟机,但是虚拟机无法ping通真实机(可能是防火墙问题)

    物理机IP地址:192.168.1.209 虚拟机IP地址:192.168.1.5.192.168.1.7.192.168.1.10 物理机设置:

  10. 修改替换/system/framework/framework.jar后重启手机为何没有效果?

    自Android 5.0开始android默认使用art(Android4.4开始有实验性质的art),取代原来的Dalvik, art会加载boot.art和boot.oat两个文件(静态编译优化, ...