Page tree
Skip to end of metadata
Go to start of metadata

背景

我们通过在字段配置中,来描述这个字段应该如何填写。但它只能用流程的整个环境。有时候我们希望在不同的选择,需要进行不同的提示,那么字段填写的描述提示通过字段配置就不能进行完成。


解决方案

import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.priority.Priority
import com.atlassian.jira.issue.Status
import groovy.transform.BaseScript

@BaseScript FieldBehaviours fieldBehaviours

if ((getFieldById(status).value as Status)?.name == '进行中') {
    getFieldById('description')
        .setLabel('Why do you need this and why so important?')
        .setDescription('进行中的描述.')
} else {
     getFieldById('description')
        .setLabel('Why do you need this and why so important?')
        .setDescription('其它的描述.') 
}
  • No labels