This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AJS.$('#customfield_10000, label[for="customfield_10000"]').append('<span class="aui-icon icon-required"></span>'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AJS.$('#priority > option[value=1]').remove() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.opensymphony.workflow.InvalidInputException | |
if (issue.type.id in [10000]) { | |
throw new InvalidInputException("Not valid issue type") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function hideIssueType(issueTypeName) { | |
var elem = "<style type=\"text/css\">#issuetype-suggestions .aui-list-item-li-" + issueTypeName + " {display: none}</style>"; | |
AJS.$("head").append(elem); | |
} | |
hideIssueType('application') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function ($) { | |
function hideField(fieldId) { | |
$('div.field-group:has(#customfield_' + fieldId + ')').hide() | |
} | |
function isUserInGroup(groupName) { | |
return JS_INCLUDER.params.userDetails.groupNames.indexOf(groupName) != -1 | |
} | |
if (isUserInGroup('jira-users')) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Как объявить переменную | |
def a = 5 //целое число | |
def а = -5.4 //отрицательное число с дробной частью | |
def a = 'test' //обычная строка | |
def a = true //логическая переменная true/false | |
def a = null //значение отсутствует | |
//как вернуть/вывести на кран значение | |
return a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.atlassian.jira.component.ComponentAccessor | |
def getCustomFieldValue(issue, Long fieldId) { | |
ComponentAccessor.customFieldManager.getCustomFieldObject(fieldId)?.getValue(issue) | |
} | |
def customSelects = [10001,10002,10003]//todo set Custom Select List field id | |
def rezult = 1 | |
customSelects.each{cfId-> | |
rezult *= getCustomFieldValue(issue, cfId)?.data as Integer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.atlassian.jira.component.ComponentAccessor | |
import groovy.json.JsonSlurper | |
cfStep = ComponentAccessor.customFieldManager.getCustomFieldObject(10003)//Text Field (single line) | |
cfCustomSelect = ComponentAccessor.customFieldManager.getCustomFieldObject(10004)//Custom Select List | |
def customSelectValue = issue.getCustomFieldValue(cfCustomSelect) | |
if(!customSelectValue){ | |
return false | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.atlassian.jira.component.ComponentAccessor | |
import com.opensymphony.workflow.InvalidInputException | |
def CUSTOM_FIELD_ID = 14910L | |
def MESSAGE_ERROR = "Field ${getCustomFieldObject(CUSTOM_FIELD_ID)} is required" | |
if(!getCustomFieldValue(issue, CUSTOM_FIELD_ID)){ | |
throw new InvalidInputException(MESSAGE_ERROR) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.atlassian.jira.component.ComponentAccessor | |
import groovy.json.JsonSlurper | |
cfStep = ComponentAccessor.customFieldManager.getCustomFieldObject(10003)//Text Field (single line) | |
cfCustomSelect = ComponentAccessor.customFieldManager.getCustomFieldObject(10004)//Custom Select List | |
def customSelectValue = issue.getCustomFieldValue(cfCustomSelect) | |
def processApproval = parseText(customSelectValue.getData()) | |