Showing posts with label scriptrunner. Show all posts
Showing posts with label scriptrunner. Show all posts

December 15, 2022

ScriptRunner: Create Comment or Write Text Field with Links

I didn't find any documentation for this one.
I wanted in a ScriptRunner listener to document the action done by the listener with a comment in the impacted issue, with a link in the comment pointing to the user documentation.

You can do this easily by formatting links with [linktext|linkurl]

Here is an example of code for a comment:

commentBody = "[Listener|https://confluenceroot/pages/viewpage.action?pageId=375883539] labelled the issue with 'suspect_mod' because parent issue ${issue.key} had following fields changed while in Status 'Closed':" + commentBody

// flag current issue
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.jiraAuthenticationContext.loggedInUser
def commentManager = ComponentAccessor.getCommentManager()


// Add a comment to issue
commentManager.create(issue, user, commentBody, true)

December 8, 2022

ScriptRunner: Listener triggered on field change

Wanting to trigger a script upon an issue update and specifically upon changes on specific issue fields is a common use case in Jira. I have learned recently the right way to do it.

ScriptRunner Listener for Suspect flagging

I share in this post how to implement a suspect mechanism in Jira using a ScriptRunner listener.

October 26, 2022

ScriptRunner Listener: Project Blacklist

There is no built-in way in the ScriptRunner UI to define a project blacklist. I share my learning here, how to do this.

October 7, 2022

ScriptRunner Listener for IssueLinkCreatedEvent or IssueLinkDeletedEvent: no current issue?

I have struggled a bit with implementing a Link Listener with Jira / Scriptrunner and share my learning here.

August 9, 2022

ScriptRunner: set custom field with change visible in the history log

I had some troubles to get the changes done in a ScriptRunner listener visible in the issue history. I share in this post my learnings.

August 1, 2022

Jira: Issue Template

I was looking for a solution to create a Jira Issue with a prefilled Description aka. Issue Template.
I share here my learnings and solutions.

June 27, 2022

Jira: ScriptRunner: Constrained Create Issue Dialog for quick deriving Issue with link action

I have struggled a bit with the ScriptRunner "Constrained  Create Issue Dialog" feature and share here my learnings.