You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I need to slightly change the summary on a lot of issues. So I created a workflow with an action to do this and I created the following postfunction script:
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.event.type.EventDispatchOption
IssueManager im = ComponentAccessor.getIssueManager()
MutableIssue currentIssue = im.getIssueObject(issue.key) as MutableIssue
ApplicationUser loggedInUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
String summary = issue.getSummary()
String newSummary = ""
log.warn("Summary: "+summary)
if (summary.endsWith("(Alfa)")) {
newSummary = summary.replaceAll("\\(Alfa\\)","(XX)")
log.warn("New summary: "+newSummary)
currentIssue.setSummary(newSummary)
def changedIssue = im.updateIssue(loggedInUser, currentIssue, EventDispatchOption.ISSUE_UPDATED, false)
log.warn("Updated: "+changedIssue.key)
} else {
log.warn("Nothing to do")
}
If you're using a recent version of Scriptrunner to run the scripts, you can use HAPI to simplify the script:
def issue = Issues.getByKey('SR-1') as MutableIssue
issue.set {
setPriority('Highest')
setSummary('my new summary')
}
issue.store()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Michael Madsen and to do some expectation management: I will am not a coder and probably won't solve your problem :)
Have you tried asking chatPBT?
@Rodney Nissen had an interesting article yesterday about that. Check it out and let us know how it went. Of course try the code out in a test environment and all that.
HTH,
KGM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yep, I've seen it asked around 400 Jira questions, including 50 that were coding, it only gave one that wasn't subtly or horribly wrong, and in the code, invented APIs and calls that simply don't exist.
It's not a bad idea, I'd use it, but only after it's been trained on a subject with a decent dataset (and that means "not Stackoverflow" for a lot of subjects, as there's a lot of really bad answers there). It certainly has not been trained on Atlassian stuff yet.
But there are people working on it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.