It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Scriptrunner send an email function, workflow button click always fails

Hi

I'm trying to get round the limitations of Jira Service Desk automation by using Scriptrunner for the approval functionality, The main reason for this is we want to include custom fields in the emails that go to approvers so they can get all the change ticket info in the email then click approve/decline from there.

Email code:

Dear <% out << issue.assignee?.displayName %>,
<br>
The $issue.issueType.name $issue.key with priority <% out << issue.priority?.name %> has been assigned to you.
<br>
Description: ${issue.description}
<br>
Implementation Details: <% out << issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Implementation Details")) %>
<br>
Regards,
<% out << issue.reporter?.displayName %>
${getWorkflowButtons.call()}

send email.png

I've gotten as far as adding the example on the scriptrunner quick reference and modifying it a bit, it's even including the workflow buttons


email.png

Unfortunately every time I try and click the workflow button I get errors.

result.png

I've even tried removing the approval function from the statuses to see if that was the issue but nope, same issue, thought it might have been the post function being to high in the post functions order but nope, made it the last thing in the list and still the same result.

 

I'm not much of a coder at all, have to go scraping for examples whenever I want to do something like this, so, is there a way I can get this working?

 

Only other option is to try and copy the contents of 5 custom text fields to the bottom of the description and let the JSD approval emails do it, only problem is I cant find a script for that either XD

 

Any help would be appreciated

4 answers

1 accepted

0 votes
Answer accepted

This was a confirmed bug and was resolved on versions 5.5.0 & 5.5.2 of ScriptRunner for Jira Server/Datacenter. 

0 votes

@Stephen Letch

This to me looks like a ScriptRunner bug. I'd suggest raising a ticket with them see link below. 

ScriptRunner Product Support

Let me know if you have any other questions. Well done on scrapping this together! It looks good. :)

Have done, thanks

Like Brittany Wispell likes this

@Stephen Letch  did you get a solution for this issue. I am having the exact same issue you are having.

Thanks

I will get with our ScriptRunner team to see if this has been updated yet. 

Like Binaya Kc likes this

Any update on this @Brittany Wispell ?

@Bney  & @Binaya Kc 

It was confirmed a bug and was resolved on versions 5.5.2 of ScriptRunner for Jira Server/Datacenter. 

If you have any other questions please let me know. 

Like Binaya Kc likes this

Hi @Brittany Wispell 

I have Done button (which is global transition ) in workflow. When I use a getWorkflowButtons.call(), jira send to approver Accept, Reject and global Done buttons. Is any way to send message without Done buton? I add condition to Done transition issue.status.name != 'In review' but this doesn't help.obraz.png

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

303 views 1 3
Join discussion

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you