Severe Acknowledgements

I'm trying to figure out a way to convert a script we are using in our production environment that still utilizes the XML Jelly scripting in JIRA to the newer Java based Groovy scripts with the current version. Basically what it does is send out notifications to various IT personnel until the issue is acknowledged. I have been looking around ScriptRunner but can't find any way to accomplish this, anyone have any thoughts?

 

Here is a copy of the code:

<JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" xmlns:email="jelly:email" xmlns:log="jelly:log">
<core:invokeStatic className="com.atlassian.jira.ComponentManager" method="getInstance" var="componentManager"/>
<core:invoke on="${componentManager}" method="getProjectManager" var="projectManager"/>

 

<jira:Login username="scriptingaccount" password="**********">
<log:info>Running Close issues service</log:info>
<!-- Properties for the script -->

<core:set var="filter7Days" value="12748" />

<!-- Run the SearchRequestFilter -->
<jira:RunSearchRequest filterid="${filter7Days}" var="filterResults" />

<!-- Iterate over the issues -->

<core:forEach var="issue" items="${filterResults}">


<!--Calls User Manager to Get Username & Email address-->
<core:invokeStatic className="com.opensymphony.user.UserManager" method="getInstance" var="instance"></core:invokeStatic>

<core:invoke on="${instance}" method="getUser" var="user">
<core:arg type="java.lang.String" value="${issue.assignee}"/>
</core:invoke>


<!--Email content and logged message-->

<log:warn>Sending reminder email for ${issue.key}</log:warn>
<email:email to="first.last@example.com" from="supportgroup@example.com" subject="Critical Issue: ${issue.key} ${issue.summary} needs immediate attention"
server ="mail2">

Issue ${issue.summary} requires immediate attention.

Please acknowledge the error and between work.

Requester: ${issue.reporter}
URL: https://jira.ahsrcm.com/jira/browse/${issue.key}

</email:email>
</core:forEach>
</jira:Login>
</JiraJelly>

 

Thanks for the help.

 

-Peter

 

1 answer

So, there are some built-in tools for ScriptRunner to send emails at various points.

There's a post-function and an event listener, which make it easy to fire an email when certain things happen.

It looks like your jelly script runs on a scheduled service. You could couple one of those options (an event listener or post function) with a service (perhaps the escalation service in particular) to send an email on a timed interval, rather than just waiting for a particular event or workflow to be executed.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

302 views 0 1
Read article

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