You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
We ran into a need to have to remove all request participants from the JSD ticket generated by email request handler. Essentially we do not need the CC'ed parties to be on the request, but I don't think it is configurable to avoid the addition, so we need to remove them post-creation in the ScriptRunner postfunction. Any help or direction is appreciated.
A script like this placed within a post-function will delete all of the names in the Request Participants field and just set it to an empty list.
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def requestField = customFieldManager.getCustomFieldObjects(issue).find {it.name == "Request participants"}
def changeHolder = new DefaultIssueChangeHolder()
requestField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(requestField), []),changeHolder)
You could use this in a post-function on the create issue step.
Thanks Joshua Yamdogo @ Adaptavist, just tested, it worked in the console, but it doesn't seem to work in the create post-function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dimitry,
Were you able to figure out the problem yet? If you have not, I would suggest making sure that your post-functions are in the correct order on the Create transition. Your post-function should be the last item for execution:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Depending on how you set things up, you can tackle this 2 ways i know of.
1. Have the exchange/email server remove CC and BCC users.
2. Using an addon like JWME you can have the systems workflow remove or add values to any field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. What I find hard to understand is that I know I can script addition of new request participants. How come I can not script removal of said paricipants?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
With the JWME it was super easy to add a post function to the ticket creation to strip request participants and other things.
We use the Cloud version of Jira so we dont utilize Scriptrunner. I know I see those Adaptivist gents in the forumns all the time helping folks with scripts....i would try raising a ticket with them for help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
See other comment
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.