Remove "Request Participants" using Automation rule?

I am using Jira Service Desk cloud version. The issues created on service desk via email takes the cc into Request participant. I would like to automaticalyy remove some specific participants when the issue is created.

Thanks in advance for the time !

3 answers

0 votes

At the moment within JIRA, there is not a way to add requested participants via automation.  There is a feature request for this over in JSDSERVER-3628    As such I believe the same is true for removing users via this method as well.

However there is a KB that you could use to add users, provided you use the scriptrunner plugin with JIRA and a custom script.  Details on this are in How to Automatically Add Request Participants when Creating an Issue - JIRA KB

It might be possible to use the same steps, but then modify the existing script so that it could be used to either clear that field or remove a specific user depending on your needs.

Any solution? I want to do the same thing, remove Request Participants added from cc in e-mail. By JSON "add" or "set", its the same. It just add chosen user to RP. Can't clear that field. Any advice?

Thank you! 

import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.event.issue.DelegatingJiraIssueEvent
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem
import com.atlassian.jira.issue.fields.layout.field.FieldLayoutManager
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.ComponentManager

def issue = event.getIssue()

// Get the list of participants
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def fieldLayoutManager = ComponentAccessor.getFieldLayoutManager()
def requestField = customFieldManager.getCustomFieldObjects(issue).find {((CustomField)it).name == "Request participants"}
def participants = issue.getCustomFieldValue(requestField)
def filteredParticipants = new ArrayList<ApplicationUser>()
if (participants != null) {
for (ApplicationUser participant in (ArrayList<ApplicationUser>)participants) {
if ( participant.getEmailAddress().toLowerCase() != "ADDRESS_I_WANT_TO_FILTER" )

MutableIssue editableIssue = (MutableIssue)issue
editableIssue.setCustomFieldValue(requestField, filteredParticipants)
Map<String, ModifiedValue> modifiedFields = editableIssue.getModifiedFields();
FieldLayoutItem fieldLayoutItem = fieldLayoutManager.getFieldLayout(editableIssue).getFieldLayoutItem(requestField);
DefaultIssueChangeHolder issueChangeHolder = new DefaultIssueChangeHolder();
final ModifiedValue modifiedValue = (ModifiedValue) modifiedFields.get(requestField.getId());
requestField.updateValue(fieldLayoutItem, issue, modifiedValue, issueChangeHolder);

This causes errors for me, i have no experience with scripts, any ideas? 

2017-11-13 15:18:07,526 ERROR [workflow.ScriptWorkflowFunction]: *************************************************************************************
2017-11-13 15:18:07,526 ERROR [workflow.ScriptWorkflowFunction]: Script function failed on issue: IT-2793, actionId: 1, file: <inline script>
groovy.lang.MissingPropertyException: No such property: event for class: Script5

Are you using script listener? Event should be a default property.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Friday in Jira Service Desk

Are you a Jira Service Desk agent? We want to talk to you!

Are you a whiz at handling tickets and looking at how you can further optimize your workflow with automation? Do you tackle detailed customer support questions while simultaneously getting flooded wi...

140 views 0 8
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