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. Autolayout 第三方开源库

    转载自:http://blog.csdn.net/hmt20130412/article/details/46638625 今天才发现CSDN支持markdown了…还是给出新博客地址:Autolay ...

  2. 全新安装免费的OS X Mavericks 10.9正式版--安装U盘制作指南

    承诺大家的教程来了,这个教程是介绍如何在Mac下制作安装正版USB启动安装程序,原教程出自Tonymacx86.我只是加入了自己的理解,用自己的方式给大家讲这个过程.这里要把所有的成绩归功于Tonym ...

  3. HDU 5522 Numbers

    水题 #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> us ...

  4. javascript 中获取对象的长度(map对象的长度)--js关联数组的长度

    var n = {1:100, 2:101, 3:102, 4:103}; 怎么获取这个对象n的长度呢? 方法一: function getLength(obj){ var count = 0; fo ...

  5. HttpServletRequest.getServletContext()一直提示找不到,而引出的问题

    开发j2ee项目的时候,需要用到servlet-api,如果使用了maven,web项目可以在pom.xml中手动加入所需jar包,达到与依赖j2ee libarary同样的功能.可问题来了: 1. ...

  6. linux下 mysql 学习(一)

    1.登录mysql [root@test1 local]# mysql  Welcome to the MySQL monitor. Commands end with ; or g. Your My ...

  7. 利用JavaAPI访问HDFS的文件

    body{ font-family: "Microsoft YaHei UI","Microsoft YaHei",SimSun,"Segoe UI& ...

  8. myEclipse 8.5下SVN环境的搭建

    myEclipse 8.5下SVN环境的搭建 在应用myEclips 8.5做项目时,svn会成为团队项目的一个非常好的工具,苦苦在网上寻求了一下午,终于整合好了这个环境,在这里简单介绍下,希望能为刚 ...

  9. CentOS 6.4 x64 Cacti 监控安装配置

    Cacti 监控安装配置   环境:   安装Cacti 的服务器   Linux 6.4 x64   ip 10.8.8.11     一: 配置iptables , selinux     vi ...

  10. ZOJ 3537 Cake

    区间DP. 首先求凸包判断是否为凸多边形. 如果是凸多边形:假设现在要切割连续的一段点,最外面两个一定是要切一刀的,内部怎么切达到最优解就是求子区间最优解,因此可以区间DP. #include< ...