This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
post_functions [2018/04/12 08:10] root added posting in custom text field |
post_functions [2018/06/27 13:03] (current) root |
||
---|---|---|---|
Line 87: | Line 87: | ||
def statusMessage = " | def statusMessage = " | ||
issue.setCustomFieldValue(cfApprovalStatus, | issue.setCustomFieldValue(cfApprovalStatus, | ||
+ | </ | ||
+ | |||
+ | === Set " | ||
+ | <code java> | ||
+ | import com.atlassian.jira.component.ComponentAccessor | ||
+ | import com.atlassian.jira.issue.fields.CustomField | ||
+ | //define cfm | ||
+ | def cfm = ComponentAccessor.getCustomFieldManager() | ||
+ | |||
+ | // get value for " | ||
+ | def cfApprovalStatus = cfm.getCustomFieldObjectByName(" | ||
+ | def SelApp = cfm.getCustomFieldObjectByName(" | ||
+ | def SelAppValue = issue.getCustomFieldValue(SelApp) | ||
+ | //If there is a value in the Selected Approver, set value in Approval Status | ||
+ | if (SelAppValue){ | ||
+ | issue.setCustomFieldValue(cfApprovalStatus," | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Additional actions performed on Issue Clone post function === | ||
+ | |||
+ | <code java> | ||
+ | def cfD = customFieldManager.getCustomFieldObjects(issue).find {it.name == ' | ||
+ | def cfS = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'Start Date'} | ||
+ | def cfE = customFieldManager.getCustomFieldObjects(issue).find {it.name == 'End Date'} | ||
+ | |||
+ | issue.setCustomFieldValue(cfD, | ||
+ | issue.setCustomFieldValue(cfS, | ||
+ | issue.setCustomFieldValue(cfE, | ||
+ | |||
+ | issue.summary = ' | ||
+ | |||
+ | import com.onresolve.scriptrunner.runner.util.UserMessageUtil | ||
+ | |||
+ | UserMessageUtil.success(' | ||
+ | </ | ||
+ | |||
+ | === Update Select List (Drop Down) field Status with value Waiting Approval === | ||
+ | |||
+ | <code java> | ||
+ | import com.atlassian.jira.component.ComponentAccessor | ||
+ | def cfSelect = ComponentAccessor.customFieldManager.getCustomFieldObjectByName(" | ||
+ | def cfConfig = cfSelect.getRelevantConfig(issue) | ||
+ | def value = ComponentAccessor.optionsManager.getOptions(cfConfig)? | ||
+ | it.toString() == ' | ||
+ | } | ||
+ | issue.setCustomFieldValue(cfSelect, | ||
</ | </ |