Вечер добрый, комрады!
Собственно, требуется помощь со скриптованным полем в ScriptRunner.
Суть такова: если у поля A есть значение, то поле B должно его отображать. Если у поля А значения нет, то поле B должно отображать значение поля C.
import com.atlassian.jira.component.ComponentAccessor
def bf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("A")
def cs = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("C");
if(bf) != null {
return issue.getCustomFieldValue(bf)
else
return issue.getCustomFieldValue(cs)
}
Будет ли сие работать?
А, нашёл проблему.
import com.atlassian.jira.component.ComponentAccessor
def bf = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("A")
def cs = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("C");
if(bf) {
return issue.getCustomFieldValue(bf)
} else {
return issue.getCustomFieldValue(cs)
}
Вопрос закрыт, всем спасибо.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.