Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import static com.atlassian.jira.component.ComponentAccessor.*
- import static com.atlassian.jira.issue.IssueFieldConstants.ISSUE_TYPE
- import com.atlassian.jira.issue.MutableIssue
- // ----> для документооборота
- log.setLevel(org.apache.log4j.Level.DEBUG)
- def head = "!!!!! создание подзадач !!!!! behaviour !!! скрипт инициализации "
- //log.debug head + "getActionName() = " + getActionName()
- def ff1 = getFieldById(getFieldChanged())
- if (getActionName() == "Create" && issueContext.getIssueType().isSubTask()) {
- Long parentId = getFieldById("parentIssueId").getValue() as Long
- MutableIssue parent = getIssueManager().getIssueObject(parentId)
- //if (parent.getProjectObject().getKey() in ["EFFIECER"]) {
- if (parent.getIssueTypeId().toInteger() in [
- 11203, // Client one-time contract
- 11205, // Client annex
- 11207 // Client sup.agreement
- ]) {
- ff1.setFormValue(getConstantsManager().getAllIssueTypeObjects().find{ it.name == "Client act" }.id)
- ff1.setReadOnly(true)
- } else if (parent.getIssueTypeId().toInteger() in [
- 11204, // Partner one-time contract
- 11206, // Partner annex
- 11208 // Partner sup.agreement
- ]) {
- ff1.setFormValue(getConstantsManager().getAllIssueTypeObjects().find{ it.name == "Partner act" }.id)
- ff1.setReadOnly(true)
- } else if (parent.getIssueTypeId().toInteger() in [
- 11700 // Partner support contract
- ]) {
- ff1.setFormValue(getConstantsManager().getAllIssueTypeObjects().find{ it.name == "Partner support act" }.id)
- ff1.setReadOnly(true)
- } else {
- // ff1.setFieldOptions(issueContext.getProjectObject().getIssueTypes().findAll { !(it.name in ["Client act", "Partner act", "Partner support act"]) && it.isSubTask() })
- }
- //}
- }
- // <-------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement