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. drawRect & layoutSubviews 调用时间

    首先两个方法都是异步执行.layoutSubviews方便数据计算,drawRect方便视图重绘.   layoutSubviews在以下情况下会被调用: 1.init初始化不会触发layoutSub ...

  2. java调用dll-JNA

    介绍 给大家介绍一个最新的访问本机代码的 Java 框架 —JNA . JNA(Java Native Access) 框架是一个开源的 Java 框架,是 SUN 公司主导开发的,建立在经典的 JN ...

  3. (转)Eclipse中使用Ant

    Eclipse中使用Ant 分类: JAVA 工具 服务器2014-08-05 09:59 5507人阅读 评论(0) 收藏 举报 anteclipse http://286.iteye.com/bl ...

  4. Naive Bayes在mapreduce上的实现(转)

    Naive Bayes在mapreduce上的实现 原文地址 http://www.cnblogs.com/sunrye/p/4553732.html Naive Bayes是比较常用的分类器,因为思 ...

  5. 文件I/O实现cp复制功能

    copy.c: #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include < ...

  6. 使用virsh命令创建KVM虚拟机快照

    查看虚拟机所在主机和虚拟机名称:[root@node-1 ~]# nova show a88dcf5d-c8b2-46a5-af27-a176d8235c9d|grep hyper| OS-EXT-S ...

  7. 织梦系统与discuz论坛整合方法

    如何完成dedecms模板系统与discuz论坛整合呢? 这里的整合指会员信息,会员登陆.退出的同步:论坛信息的引用:等等. 首先,我们先来安装织梦(dedecms)系统. 然后,我们在网站根目录下建 ...

  8. iOS之UILabel自适应大小

    //初始化一个label self.label=[[UILabel alloc] init]; //设置自动行数与字符换行 [self.label setNumberOfLines:0]; //给la ...

  9. mysql基础-- 一条请求执行多条SQL语句

    最近做一个数据库初始化工具的时候发现了这个问题,就是在一个Statement中执行一条SQL语句的时候可以正确执行,如果同时执行多条,就会报SQL语法错误,伤透了脑筋. 经过网上查找,发现有两种解决办 ...

  10. 将UTF8编码转化为中文 - NSString方法

    方法一: 代码如下,如有更好的方法 麻烦贴出来,这个方法是通过webview进行解码的 UIWebView *web = [[UIWebView alloc] init]; NSString *tsw ...