Hello!
I want to create a rule that checks if the Reporter is set as a Request Participant and if that is the case to remove it from the field.
Since request participants have multiple values I have no clue how to achieve this.
Ideas?
Hello @Nahuel Logghe ,
Are you considering any marketplace apps? If yes, I can show you how to make one using the Power Scripts app and the SIL scripting language.
The SIL script like this will do what you need: checks if the reporter of an issue is listed among its participants, and if so, it removes the reporter from the list of participants associated with the issue.
string[] AllParticipants = %key%.#{Request participants};
string IssueReporter = %key%.#{reporter};
if (contains(AllParticipants, IssueReporter)) {
%key%.#{Request participants} = arrayDeleteElement(AllParticipants, IssueReporter);
}
But it may need some extra rows depending on how/when you want to trigger it. In case you want this script to be triggered by the change of field value reporter or request participants, this should be configured as SIL Listener for "Issue Updated event" with the following script:
JFieldChange[] changes = lastIssueChanges(key);
for (JFieldChange c in changes) {
if (c.field == "customfield_10029" || c.field == "reporter") { // 10029 is Request participants custom field ID
string[] AllParticipants = %key%.#{Request participants};
string IssueReporter = %key%.#{reporter};
if (contains(AllParticipants, IssueReporter)) {
%key%.#{Request participants} = arrayDeleteElement(AllParticipants, IssueReporter);
}
}
}
In summary, this script will monitor changes to specific fields in an issue (reporter and requested participants), and if one of those fields is modified and the reporter is listed among the participants, it removes the reporter from the list of participants associated with the issue.
Adding some helpful documentation pages: Simple Issue Language, SIL Listener, Array functions, SIL manager .
Hope it helps!
Anna
Hi Anna,
Thank you very much. The option you are showing definitely seems to be what we need. Unfortunately, I don't think it's worth paying for the plugin's fee at this time since we will only use it for this specific case, which is not very common. Perhaps in the future, if other situations arise where we need to create scripts for our automation rules, we might consider purchasing this plugin. In any case, I am very grateful for the comprehensive solution you have provided.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can try the solution in this thread to remove user from the list.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Tansu,
Thank you very much for your response. I have reviewed that post and the other links contained within it as well. I have no experience with scripting. I understand that the script removes a fixed element from a list, but I'm wondering if it's possible to adapt that script to meet my specific needs. I need to compare two different values from two fields and conditionally remove one. The example provided doesn't seem to match my case, and I lack the expertise to modify it
Specifically, I need to compare the 'Reporter' field with the 'Request Participants' field, and if the reporter is listed among the Request Participants, then they need to be removed from Request Participants. Perhaps my approach is not correct, and there might be another way to do this?
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.