Example: Add or remove request participants
To manage Jira Service desk issue visibility in customer portal, it would be great to have a post function to add or remove users from Request Participants custom field
The logic would be the same than add or remove watchers.
With existing post functions I'm able to:
- Clear this field
- add user(s) with overwriting
- add user(s) with appending
- add users from group (groovy)
What's missing is removing user from custom fields or group. Maybe a good idea would be to have a "add or remove from user picker custom field" where you can select the destination custom field to update.
You can currently do it. To do it you should use Copy a parsed text to a field post-function with the following configuration:
Target field: "Request Participants" Parsing mode: basic** Text to be parsed: depends on the operation
- Clear the field: leave "Text to be parsed" parameter empty.
- Add user(s) with overwriting: "Text to be parsed" parameter should contain a comma separated list of usernames (don't confuse with user's full name).
Example:john.williams, david.russell, julian.bream
- Add user(s) with appending: use prefix + before the comma separated list of user names.
Example:+ john.williams, david.russell, julian.bream
If you use prefix - you will remove the separated users instead of appending.
If you want to set the field with users in a User Picker or Multi User Picker custom field, simply write the field code, since those kind of fields are rendered as a comma separated list of usernames.
Example:%{10021}
or+ %{10021}
- Add users from group: simply write + group_name . Example: use the following value in "Text to be parsed" parameter for adding all the users in group jira-users to field "Request Participants":
+ jira-users
Versions earlier than 2.2.9 have a bug making it fail when you try to add users to field "Request participants" using prefix + when the field is empty.
Other examples of that function
- Add all assignees of certain sub-task types to a "Multi-User Picker" custom field
- Add and remove a single or a set of items from multi valued fields
- Add current user to comment
- Add or remove request participants
- Add watchers from a part of the issue summary: "Summary_text - watcher1, watcher2, watcher3, ..."
- Assign issue based on the value of a Cascading Select custom field
- Assign issue to last user who executed a certain transition in the workflow
- Automatically close resolved sub-tasks when parent issue is closed
- Automatically reopen parent issue when one of its sub-tasks is reopened
- Calculate the time elapsed between 2 transition executions
- Close parent issue when all sub-tasks are closed
- Combine the values of several Multi-User picker fields
- Compose a parsed text including the "full name" or a user selected in a User Picker custom field
- Compose dynamic text by inserting field values in a text template
- Copy issue labels to a custom field
- Copy the value of a user property into a user picker
- Create a comment in sub-tasks when parent transitions
- Execute transition in epic
- Getting the number of selected values in a custom field of type Multi Select
- Limit the number of hours a user can log per day
- Make a sub-task's status match parent issue's current status on creation
- Make parent issue progress through its workflow
- Moving story to "In Progress" when one of its sub-tasks is moved to "In Progress"
- Moving story to "Ready for QA" once all its sub-tasks are in "Ready for QA" status
- Parse Email adresses to watchers list
- Parsing text from last comment and appending it to issue's summary
- Remove versions selected in a version picker custom field
- Replace certain issue link types with different ones
- Restrict parent issue from closing if it has sub-tasks that were created during a given parent issue status
- Set a Select or Multi-Select field using regular expression to express the values to be assigned
- Set assignee depending on issue type
- Set field depending on time passed since issue creation
- Set priority for issues that have been in a certain status for longer than 24 hours
- Set security level based on groups and project roles the reporter or creator are in
- Transition linked issues in currently active sprint
- Transition only a sub-task among several ones
- Transition parent issue only when certain issue sub-task types are done
- Update Cascading Select custom field with a value of the field in parent issue
- Update checkboxes custom field if a file has been attached during a transition
- Validation on issue attachments
- Validation on MIME types of issue attachments
- Writing a comment to blocked issues when blocking issues are resolved