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
// Get Story Points field ID | |
def storyPointsField = get("/rest/api/3/field") | |
.asObject(List) | |
.body | |
.find { it.name == "Story Points*" } | |
.id | |
// Cast issue.key to String | |
def eventIssue = Issues.getByKey(issue.key as String) | |
def issueType = eventIssue.issueType.name |
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.json.JsonOutput | |
def fieldId= "customfield_10083" // Id of the custom field that needs new options | |
def contextId = "10193" // Context associated with the field | |
// List of option values to be added to the custom field | |
def optionValueList = ["1","2","3"] | |
// Payload with the options (for the POST request that will add them as field options) | |
optionValueList.each |
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
// Get Story Points field ID | |
def storyPointsField = get("/rest/api/3/field") | |
.asObject(List) | |
.body | |
.find { it.name == "Story Points" } | |
.id | |
logger.info("Story Point ID : ${storyPointsField}") | |
// Cast issue.key to 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
// Get Story Points field ID | |
def storyPointsField = get("/rest/api/3/field") | |
.asObject(List) | |
.body | |
.find { it.name == "Story Points" } | |
.id | |
// Cast issue.key to String | |
def eventIssue = Issues.getByKey(issue.key as String) | |
def issueType = eventIssue.issueType.name |
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
// Retrieve the current context and issue key | |
const context = await getContext(); | |
const issueKey = context.extension.issue.key; | |
// Access the fix version field. Replace this with your own custom field Id if needed. | |
const fixVersionField = getFieldById("fixVersions"); | |
// Attempt to fetch the current issue data | |
try { | |
const res = await makeRequest(`/rest/api/3/issue/${issueKey}`); |
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 requests | |
import csv | |
# Jira credentials (hardcoded for now) | |
EMAIL = "[email protected]" | |
API_TOKEN = "your_api_token" | |
BASE_URL = "https://YOU_DOMAIN.atlassian.net/rest/api/3" | |
AUTH = (EMAIL, API_TOKEN) | |
HEADERS = {"Accept": "application/json"} |
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
// Script Listener for Customer Facing Verbatim Field Updates | |
// Configure as "Issue Updated" event listener | |
// Get the updated issue | |
def issueKey = issue.key as String | |
def hapiIssue = Issues.getByKey(issueKey) | |
// Check if "Customer facing Verbatim" field was updated | |
def changelogItems = changelog.items | |
def customerFacingVerbatimChanged = changelogItems.find { item -> | |
item.field == "Customer facing Verbatim" | |
} |
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.json.JsonOutput | |
import java.text.SimpleDateFormat | |
// Step 1: Get version ID from the event | |
def versionData = binding.variables.version as Map | |
def versionId = versionData?.id | |
if (!versionId) { | |
logger.warn("⚠️ Version ID not found in binding. Skipping sync.") | |
return | |
} |
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
// Cast version object from binding to a Map | |
def versionData = binding.variables.version as Map | |
if (versionData) { | |
def name = versionData['name'] ?: "N/A" | |
def description = versionData['description'] ?: "N/A" | |
def released = versionData['released'] | |
def archived = versionData['archived'] | |
def overdue = versionData['overdue'] | |
def projectId = versionData['projectId'] |
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
const customerFacingVarbatimField = getFieldById("customfield_27449"); | |
const customerFacingVarbatimFieldValue = customerFacingVarbatimField.getValue()?.value; | |
const responseField = getFieldById("customfield_20579"); | |
const responses = { | |
"Fix Released": "The issue has been fixed in [Version X.Y.Z] released on [Date]. Please upgrade to apply the fix.", | |
"Fix in Progress": "Actively working on a fix, expected in our upcoming patch [on Date].", | |
"Under Investigation": "The issue/request is under investigation. Updates will follow.", | |
"Workaround Provided": "[Share workaround].", |
NewerOlder