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 delegator = (DelegatorInterface) ComponentAccessor.getComponent(DelegatorInterface) | |
String helperName = delegator.getGroupHelperName("default") |
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
{{issue.description.match("Submitted by: (\w+)@vmware\.com")}} |
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 groovy.transform.BaseScript | |
import com.onresolve.jira.groovy.user.FieldBehaviours | |
@BaseScript FieldBehaviours fieldBehaviours | |
final String screenName = 'Resolution screen' | |
//final String targetTransition = 'Accept' | |
def comment = getFieldById("comment") |
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.onresolve.jira.groovy.user.FieldBehaviours | |
import groovy.transform.BaseScript | |
import com.atlassian.jira.component.ComponentAccessor | |
import com.atlassian.jira.issue.Issue | |
import com.atlassian.jira.issue.IssueManager | |
@BaseScript FieldBehaviours behaviours | |
def epicLink = getFieldById(fieldChanged) | |
def epicLinkValue = epicLink.value as String |
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 com.atlassian.jira.issue.ModifiedValue | |
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder | |
import com.atlassian.jira.issue.CustomFieldManager; | |
import com.atlassian.jira.issue.MutableIssue; | |
import com.atlassian.jira.issue.index.IssueIndexingService; | |
def customFieldManager = ComponentAccessor.getCustomFieldManager() |
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 com.atlassian.jira.security.roles.ProjectRoleManager | |
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser() | |
def projectRoleManager = ComponentAccessor.getComponentOfType(com.atlassian.jira.security.roles.ProjectRoleManager) | |
def testerRole = projectRoleManager.getProjectRole("contractor") | |
def project = issue.getProjectObject() | |
log.warn project |
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 com.atlassian.jira.security.login.LoginManager | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import com.atlassian.jira.user.util.UserUtil | |
UserUtil userUtil = ComponentAccessor.getUserUtil() | |
def loginManager = ComponentAccessor.getComponentOfType(LoginManager.class) | |
def groupManager = ComponentAccessor.getGroupManager() |
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 org.jsoup.Jsoup | |
def html = "<div class=\"table-wrap\"><table data-layout=\"wide\" data-local-id=\"fa416b5e-c36e-4c93-85b8-ac5652cdecf0\" class=\"confluenceTable\"><colgroup><col style=\"width: 320.0px;\"/><col style=\"width: 320.0px;\"/><col style=\"width: 320.0px;\"/></colgroup><tbody><tr><th class=\"confluenceTh\"><p><strong>Instance</strong></p></th><th class=\"confluenceTh\"><p><strong>Users</strong></p></th><th class=\"confluenceTh\"><p><strong>Projects</strong></p></th></tr><tr><th class=\"confluenceTh\"><p>JSD</p></th><td class=\"confluenceTd\"><p>1000</p></td><td class=\"confluenceTd\"><p>2000</p></td></tr><tr><th class=\"confluenceTh\"><p>Jira Core</p></th><td class=\"confluenceTd\"><p>2000</p></td><td class=\"confluenceTd\"><p>4000</p></td></tr></tbody></table></div><p />" | |
def table = Jsoup.parse(html).select('table').first() | |
def rows = table.select('tr') | |
// find the JSD row | |
def jsdRow = rows.find { it.select('th').first().text() == 'JSD' } |
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 org.apache.http.HttpResponse | |
import org.apache.http.client.HttpClient | |
import org.apache.http.client.methods.HttpPost | |
import org.apache.http.entity.StringEntity | |
import org.apache.http.impl.client.HttpClientBuilder | |
import org.apache.http.util.EntityUtils | |
import groovy.json.JsonSlurper | |
def url = 'https://api.openai.com/v1/chat/completions' | |
def apiKey = 'sk-j4qZQqwS5Lczu3wRgER3TFJbALfxVk99xgsfiJmTlm4' |
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 org.apache.http.HttpResponse | |
import org.apache.http.client.HttpClient | |
import org.apache.http.client.methods.HttpPost | |
import org.apache.http.entity.StringEntity | |
import org.apache.http.impl.client.HttpClientBuilder | |
import org.apache.http.util.EntityUtils | |
def url = 'https://api.openai.com/v1/chat/completions' | |
def apiKey = 'sk-j4qZQqwS5Lczu3wRgER3T3BlbkFJbALfxVk99xgsmTlm4' | |
def prompt = 'Hello, ChatGPT!' |