This file contains hidden or 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.stash.event.pull.PullRequestMergeActivityEvent | |
| import com.atlassian.stash.pull.PullRequestAction | |
| def event = event as PullRequestMergeActivityEvent | |
| if (event.action != PullRequestAction.MERGED) { | |
| // not a merge, we don't care about this event so return false | |
| return false | |
| } |
This file contains hidden or 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 | |
| import com.atlassian.jira.ComponentManager | |
| import org.apache.log4j.Category | |
| import java.text.SimpleDateFormat | |
| // Logger | |
| def Category log = Category.getInstance("com.onresolve.jira.groovy.zzz_Get_History_For_Issue") | |
| def changeLoop = 0 |
This file contains hidden or 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
| FormField formComponent = getFieldById(fieldChanged) | |
| FormField formSubcomponent = getFieldByName("Subcomponent") | |
| Object componentFormValue = formComponent.getFormValue() | |
| List componentIds = [] | |
| if (componentFormValue instanceof List) { | |
| componentIds.addAll(componentFormValue as List) | |
| } | |
| else { |
This file contains hidden or 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.ComponentManager | |
| import com.atlassian.jira.ManagerFactory | |
| import com.atlassian.jira.permission.PermissionSchemeManager | |
| import com.atlassian.jira.scheme.SchemeEntity | |
| import org.apache.log4j.Level | |
| import org.apache.log4j.Logger | |
| import org.ofbiz.core.entity.GenericValue | |
| import static com.atlassian.jira.security.Permissions.VIEW_WORKFLOW_READONLY | |
| Logger log = Logger.getLogger("OneOffAddViewWorkflowPermission"); |
This file contains hidden or 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.adaptavist.serverconfig | |
| import com.atlassian.jira.component.ComponentAccessor | |
| import com.atlassian.jira.issue.fields.CustomField | |
| import com.onresolve.jira.groovy.user.FieldBehaviours | |
| import com.onresolve.jira.groovy.user.FormField | |
| import org.apache.log4j.Logger | |
| import java.util.Map.Entry |
This file contains hidden or 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 issue = ComponentAccessor.getIssueManager().getIssueObject("JRA-1") | |
| def beanBuilderFactory = ComponentAccessor.getOSGiComponentInstanceOfType(BeanBuilderFactory.class) | |
| def issueBeanBuilder = beanBuilderFactory.newIssueBeanBuilder(issue, IncludedFields.includeAllByDefault((List) null)) | |
| JiraBaseUrls jiraBaseUrls = (JiraBaseUrls)ComponentAccessor.getComponent(JiraBaseUrls.class); | |
| UriBuilder uriBuilder = UriBuilder.fromPath(jiraBaseUrls.restApi2BaseUrl()); | |
| def issueBean = issueBeanBuilder.uriBuilder(uriBuilder).expand("").build() | |
| log.debug new DefaultJaxbJsonMarshaller(true).marshal(issueBean) |
This file contains hidden or 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
| WARN [canned.common.admin.RunUnitTests] Test: basic tests(com.onresolve.jira.groovy.functional.behaviours.TestBehaviours) failed | |
| geb.driver.DriverCreationException: failed to create driver from callback 'script14213377010741169782931$_run_closure1@12ff9c7d' | |
| at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35) | |
| at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:85) | |
| at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy) | |
| at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:32) | |
| at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:84) | |
| at geb.Configuration.createDriver(Configuration.groovy:361) | |
| at geb.Configuration.getDriver(Configuration.groovy:350) | |
| at geb.Browser.getDriver(Browser.groovy:105) |
This file contains hidden or 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.answers | |
| import com.atlassian.jira.component.ComponentAccessor | |
| import com.atlassian.jira.issue.Issue | |
| import com.atlassian.jira.issue.comments.Comment | |
| def commentManager = ComponentAccessor.getCommentManager() | |
| def thisComment = transientVars["comment"] | |
| Issue issue = issue |
This file contains hidden or 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.answers | |
| import com.atlassian.jira.event.issue.AbstractIssueEventListener | |
| import com.atlassian.jira.event.issue.IssueEvent | |
| import com.atlassian.jira.event.issue.IssueEventDispatcher | |
| import com.atlassian.jira.event.type.EventType | |
| import groovy.util.logging.Log4j | |
| import org.apache.log4j.Level | |
| @Log4j |
This file contains hidden or 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.sql.Sql | |
| import org.ofbiz.core.entity.ConnectionFactory | |
| import org.ofbiz.core.entity.DelegatorInterface | |
| import java.sql.Connection | |
| def projectManager = ComponentAccessor.getProjectManager() | |
| delegator = (DelegatorInterface) ComponentAccessor.getComponent(DelegatorInterface.class) | |
| String helperName = delegator.getGroupHelperName("default"); |