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
// check the project key here is the same as the project key in the sync script | |
// and check the custom field ID is that of your assets custom field. Single picker is assumed | |
let assetsIdMap = new Project("JRA").properties.KVP_List; | |
issue.attachments.some(attachment => | |
issue.customfield_10312.length ? | |
attachment.filename == assetsIdMap[issue.customfield_10312[0].objectId] + '.png' : | |
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 java.util.stream.StreamSupport | |
def apiToken = API_TOKEN // Create a "Script Variable" for your api token with the name API_TOKEN. Create one at https://id.atlassian.com/manage-profile/security/api-tokens | |
def aqlQuery = 'objectType = Host' // AQL query - use the same query for the dropdown | |
def projectKey = 'JRA' // Project that we store the map of asset IDs and names on - any will do but use the one associated with this business process | |
def workspaceId = 'eaf39d78-2ea5-4a88-ad4f-35feb122f0c7' // Workspace ID - for assets - get it from https://<your-site>.atlassian.net/rest/servicedeskapi/assets/workspace | |
def search = { -> | |
def iterator = new Iterator<List<Map>>() { | |
private boolean hasMoreResults = true |
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.atlassian.jira.project.Project | |
import com.atlassian.servicedesk.api.ServiceDeskService | |
import com.atlassian.servicedesk.api.organization.CustomerOrganization | |
import com.atlassian.servicedesk.api.organization.OrganizationService | |
import com.atlassian.servicedesk.api.util.paging.SimplePagedRequest | |
import com.atlassian.upm.api.license.entity.Organization | |
import com.onresolve.scriptrunner.parameters.annotation.ProjectPicker | |
import com.onresolve.scriptrunner.runner.customisers.PluginModule | |
import com.onresolve.scriptrunner.runner.customisers.WithPlugin |
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
package com.onresolve.jira.groovy.jql | |
import com.atlassian.jira.component.ComponentAccessor | |
import com.atlassian.jira.jql.parser.JqlQueryParser | |
import com.atlassian.jira.jql.query.LuceneQueryBuilder | |
import com.atlassian.jira.jql.query.QueryCreationContext | |
import com.atlassian.jira.user.ApplicationUser | |
import com.atlassian.jira.util.MessageSet | |
import com.atlassian.query.clause.TerminalClause | |
import com.atlassian.query.operand.FunctionOperand |
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
// Please see https://library.adaptavist.com/entity/provides-a-rest-api-for-creating-editing-and-sorting-select-list-options |
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
package examples.champs | |
import com.atlassian.jira.bc.user.UserService | |
import com.atlassian.jira.component.ComponentAccessor | |
def userService = ComponentAccessor.getComponent(UserService) | |
def createValidationResult = UserCreationUtil.validateUserCreation(issue) | |
if (!createValidationResult.isValid()) { | |
throw new Exception('fail') |
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 selectValue = getFieldByName("MultiSelectA").getValue() as List | |
getFieldByName('Another Field').setHidden(!selectValue?.contains("AAA")) | |
getFieldByName('Yet Another Field').setHidden(!selectValue?.contains("BBB")) |
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.atlassian.jira.config.properties.APKeys | |
import com.atlassian.sal.api.net.Request | |
import com.atlassian.sal.api.net.TrustedRequest | |
import com.atlassian.sal.api.net.TrustedRequestFactory | |
import com.onresolve.scriptrunner.runner.customisers.PluginModule | |
import groovyx.net.http.URIBuilder | |
@PluginModule | |
TrustedRequestFactory trustedRequestFactory |
NewerOlder