Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation to trigger an email whenever the value of the Business Process Owner group

Pavan kumar Mamidipaka
Contributor
July 2, 2026

configuring  Automation to trigger an email whenever the value of the Business Process Owner group and my Business Process Owner group type as a Group picker(single group) and i want to implmented thrght Script runner and i am using JIRA cloud 
For example: my taget status is Submitted and Business Process Owner group is it group so i want to send an email to it group peoples and my taget status is draft and Business Process Owner group is PSC review group  so i want to send an email to PSC review group peoples 

2 answers

1 vote
Gor Greyan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 2, 2026

Hi @Pavan kumar Mamidipaka

Thanks for the question.

If I understand your requirement correctly, you want to send an email to the members of the group selected in the Business Process Owner field whenever the issue transitions to a specific status.

If that's the case, could you let me know whether you're using Jira Automation only, or are you planning to use ScriptRunner as well? Also, is the Business Process Owner field a native Jira Group Picker or a ScriptRunner custom field?

The answer will determine whether this can be achieved using native automation or if you'll need to retrieve the group members through a scripted solution.

Pavan kumar Mamidipaka
Contributor
July 2, 2026

I want to implmented using Script runner but i am using the normal field 

Gor Greyan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 2, 2026

Dear @Pavan kumar Mamidipaka

I have tested the group lookup and notif flow in Jira Cloud and it worked.
User this script.

def groupFieldId = "customfield_10064" // Change your actual field ID
def targetStatus = "Draft" // Change your target status

if (issue.fields.status.name != targetStatus) {
return
}

def groups = issue.fields[groupFieldId] as List

if (!groups) {
logger.warn("No group selected.")
return
}

def users = []

groups.each { group ->
def membersResp = get("/rest/api/3/group/member")
.queryString("groupId", group.groupId)
.asObject(Map)

membersResp.body.values.each { user ->
if (user.active) {
users << [accountId: user.accountId]
}
}
}

users = users.unique { it.accountId }

if (!users) {
logger.warn("No active users found in the selected group.")
return
}

def notifyBody = [
subject : "Issue ${issue.key} requires your attention",
textBody: "Issue ${issue.key} has transitioned to ${targetStatus}.",
htmlBody: "Issue <b>${issue.key}</b> has transitioned to <b>${targetStatus}</b>.",
to: [
users: users
]
]

post("/rest/api/3/issue/${issue.key}/notify")
.header("Content-Type", "application/json")
.body(notifyBody)
.asString()

Pavan kumar Mamidipaka
Contributor
July 2, 2026

i want to implement Same code for each and every status right??

Pavan kumar Mamidipaka
Contributor
July 2, 2026

While implementing this code through Script runner behaviour i am getting the comile time errors and how do you implement.

Gor Greyan
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
July 2, 2026

Dear @Pavan kumar Mamidipaka

For this requirement, I would not implement it as a Behaviour. Behaviours are mainly for controlling field behaviour on the issue screen, such as showing/hiding fields, making fields required, or setting field values while the user is editing the issue.

Since you want to send an email when the issue reaches a specific status, the better place to implement this is a ScriptRunner Script Listener or a workflow-related script.

You also don't need to create the same script for every status. You can use one script and check the current status inside it, or configure the listener for the specific transition/status you need.

If you can share the compile error and confirm the exact status where the email should be sent, I will adjust the script for that listener context.

0 votes
Gabriela
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 3, 2026

Hi @Pavan kumar Mamidipaka,

You don't actually need ScriptRunner for this. Native automation can send straight to a Jira group and every member of it gets the email. The one thing it won't do is turn your group-picker field's value into member addresses on its own: the email action's recipient dropdown (Send customized email) only takes static groups or user-picker fields, and a group-picker smart value returns the group's name, not emails.

Since you're dealing with a small fixed set of groups, branch on the field instead. Trigger on the status transition, then add an If/else block: if Business Process Owner is "IT Group", send with the recipient set to the IT Group; else if it's "PSC Review Group", send to that one. No per-status code to duplicate.

https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events