Script Runner: Fast-track transition an issue additional issue actions don't work

Hi,

 

I'm using JIRA 7.1.4 and Script Runner 4.3.0. In the create step i use the post script function to fast-track transition an issue. The post function is at the last place after the event. My condition is:

cfValues['Field A'] != 'Value A' && cfValues['Field B']?.value == null

This works fine, the desired transition is applied and the issue is closed directly.

But the additional issue actions don't work. I want to set a comment and use the example given by script runner:

issueInputParameters.setComment('Write your comment here').

But nothing happens, no comment is created. There is no message in the JIRA log and the post function only says "No failures in the last 15 execution(s)".

 

So am I missing anything?

1 answer

1 accepted

1 votes

This will only work if you have a screen on the transition and you have:

issueInputParameters.setSkipScreenCheck(true)

Although theres a bug in JIRA IssueService on some versions, causing the commenting to be done twice.

I would use CommentManager to do this. So the script to use is:

def commentManager = com.atlassian.jira.component.ComponentAccessor.getCommentManager()
commentManager.create(issue, currentUser, "A comment", true)

Thank you Adam,

now it works!

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,788 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot