View test gist.html
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
<html> | |
<script> | |
alert(123) | |
</script> | |
123123 | |
</html> |
View Jira-JsIncluder-example-set fixVersion.js
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 setFixVersion(version) { | |
var val = AJS.$("#fixVersions").val(); | |
val = val ? val : []; | |
val.push(version.id); | |
AJS.$("#fixVersions").val(val); | |
AJS.$("#fixVersions-textarea").val(version.name).blur(); | |
} | |
var versions = [ | |
{ |
View Jira-JsIncluder-example-set component.js
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 setComponent(component) { | |
var val = AJS.$("#components").val(); | |
val = val ? val : [] | |
val.push(component.id) | |
AJS.$("#components").val(val); | |
AJS.$("#components-textarea").val(component.name).blur(); | |
} | |
var components = [ | |
{ |
View Jira-JsIncluder-example-set select value.js
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
//select | |
AJS.$('#customfield_10001').val(10002) | |
//multiselect | |
AJS.$('#customfield_10000').val([10000, 10001]) | |
//cascade select | |
AJS.$('#customfield_10002').val(10004).change() | |
AJS.$('#customfield_10002\\:1').val('10005') |
View Jira-JsIncluder-example-set assignee.js
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 ($) { | |
setAssignee('admin'); | |
function setAssignee(name) { | |
var setValue = name; | |
var $field = $("#assignee"); | |
$.get(AJS.params.baseURL + "/rest/api/latest/user", { | |
username: setValue | |
}, function (data) { | |
$("#assignee-single-select").remove(); |
View Jira-JsIncluder-example-remove resolution.js
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.$('#resolution > option[value=10000]').remove() |
View Jira-JsIncluder-example-add required.groovy
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 getCustomFieldValue(issue, Long fieldId) { | |
issue.getCustomFieldValue(ComponentAccessor.customFieldManager.getCustomFieldObject(fieldId)) | |
} | |
if (!getCustomFieldValue(issue, 10000)) { | |
throw new InvalidInputException("Please indicate the reason for the increased priority") | |
} |
View Jira-JsIncluder-example-add required.js
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>'); |
View Jira-JsIncluder-example-hide priority.js
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() |
View Jira-JsIncluder-example-hide issue type.groovy
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") | |
} |
NewerOlder