JIRA描述默认值设置
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:
- Locate and backup the file: WEB-INF/classes/templates/jira/issue/field/description-edit.vm
- 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'))
- 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'))
- 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…” 替换成输入中文,生效后,界面将会直接显示乱码或者报错,这个。。。该怎么解决这个问题?待研究。如哪位童鞋知道有解决方法,请告之一下,谢谢。
- 替换方案
方案吧,也简单,不用中文,直接用英文。。。目前只能使用英文格式暂时先用着,如下:
#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描述默认值设置的更多相关文章
- php与js中函数参数的默认值设置
php函数参数默认值设置: <?phpfunction test($val=3){ echo $val."<br/>";}test(11);test();?& ...
- js方法参数默认值设置
这里的默认值设置 很容易以为和php相似 function(v1,v2="test") { alert(v2); } 但这样是不对的,js方法,如需传参,甚至可以不用预定义(也就是 ...
- sqlserver中GUID的默认值设置
sqlserver中GUID的默认值设置 YID uniqueidentifier not null default (NEWSEQUENTIALID()), //有序GUID(只能用于表设计的时候的 ...
- yii2中textarea中的默认值设置
1. view中显示文本域的位置 <?= $form->field($goods_model, 'goods_introduce')->textArea(['class'=>' ...
- asp.net EF model中的默认值设置
在做数据库规划时,通常会规划一些系统字段,也就是由数据库本身自行指定默认值到这个字段上,创建新的“创建时间(CreateDate)”字段就会常常这样设计. 如果希望能有默认值,且让.net 程序在新增 ...
- UEditor富文本WEB编辑器自定义默认值设置方法
1.在使用UEditor编辑器编写内容时你会发现,当输入的内容较多时,编辑框的边框高度也会自动增加,若希望输入内容较多时以拉框滚动的效果. 方法:找到Ueditor文件根目录下的ueditor.con ...
- 【第十五章】 springboot + pojo默认值设置
我们有时需要给POJO设置默认值 pojo设置(推荐) 1.User package com.xxx.firstboot.domain; import lombok.Getter; import lo ...
- 第十五章 springboot + pojo默认值设置
我们有时需要给POJO设置默认值 pojo设置(推荐) 1.User package com.xxx.firstboot.domain; import lombok.Getter; import lo ...
- C#属性默认值设置
关于在MVC中view中设置默认值,可以象如下设置: 1.关于VIEWMODEL的部分 如果是C# 6.0,网上资料查到说可以 如果语法不支持,只能改回.net 2.0的写法. public cla ...
随机推荐
- APK自我保护方法
标 题: [原创]APK自我保护方法 作 者: MindMac 时 间: 2013-12-28,21:41:15 链 接: http://bbs.pediy.com/showthread.php?t= ...
- Quartz总结(一):Quartz集成Spring的2个方法
零.引言 关于Spring集成Quartz有2种方法: 1. JobDetailBean. 2. MethodInvokeJobDetailFactoryBean. 以下从自身使用和理解以及掌握的知识 ...
- STM32开发指南-蜂鸣器实验
另一种I/O作为输出的应用,利用一个I/O来控制板载的有源蜂鸣器,实现蜂鸣器控制. PS:有源蜂鸣器自带了震荡电路,一通电就会发声:无源蜂鸣器则没有自带震荡电路,必须外部提供2~5Khz左右的方波驱动 ...
- EXCEL读写NPOI--导出功能
第一步:将NPOI中的一下三个文件复制到项目中
- System.InvalidCastException: 无法将类型为“Microsoft.Office.Interop.Word.ApplicationClass”的 COM 对象强制转换为接口类型“Microsoft.Office.Interop.Word._Application”。
报错:System.InvalidCastException: 无法将类型为“Microsoft.Office.Interop.Word.ApplicationClass”的 COM 对象强制转换为接 ...
- Tesseract-OCR使用记录
Tesseract是一个开源的OCR(Optical Character Recognition,光学字符识别)引擎,可以识别多种格式的图像文件并将其转换成文本,目前已支持60多种语言(包括中文). ...
- [Unity]Unity开发NGUI代码实现ScrollView(放大视图)
Unity开发NGUI代码实现ScrollView(放大视图) 下载NGUI包 导入NGUI3.9.1版本package 创建MainCameraScript.cs脚本 MainCameraScrip ...
- jstl-按照html的形式输出至页面
一.按照html的形式输出至页面 <c:out value="${xxx}" default="默认值" escapeXml="false&qu ...
- Python字符串的encode与decode研究心得——解决乱码问题
转~Python字符串的encode与decode研究心得——解决乱码问题 为什么Python使用过程中会出现各式各样的乱码问题,明明是中文字符却显示成“/xe4/xb8/xad/xe6/x96/x8 ...
- abs函数
absolute 绝对值函数 abs函数是一个取绝对值函数,你得确保ABS()括号里的表达式所计算出的结果是数字,String是字符串的意思,你括号你的数据肯定是字符串了,如果A.B两变量你是这样定义 ...