JMWE roleMembers function

Paul Alexander
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 Leaders.
March 19, 2021

I use this snippet from my JMWE add-on to identify, by name, who is receiving an email notification on a certain event so folks know who has also been informed. I call this in a post function in a workflow. It works great and has for a couple years. I have some team members who have terminated employment with us. I detached them from the group called 'Production Support' that this function references before terminating their Atlassian Accounts. However, these terminated members (Bart and Lisa in my example below) are still returned in the list. It's not just these two users - anyone that previously worked with me who was in a group by this name is still identified in this emails. Is there an additional qualifier I can pass to this function to exclude inactive members? I couldn't spot one in the documentation. Thanks a lot for reading.

 

This notice was sent to:
<br/>
{{'Production Support' | roleMembers(true) | join(',')}}

 

Example output:

This notice was sent to:
Bart Simpson,Lisa Simpson,Tom Jones

 

Thanks,

-Paul

1 answer

1 accepted

0 votes
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 19, 2021

Hi @Paul Alexander 

you mentioned a Production Support group but the Nunjucks expression refers to a project role. Did you remove these users from the project role? If so, there is no reason why they would be returned by the roleMembers filter.

Paul Alexander
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 Leaders.
March 19, 2021

Sorry, David, I did state `groups` but I meant the `project role`. I double checked that the terminated members are not in this project role called 'Production Support'. In fact, the members are in no groups at all and no project roles at all. And all of the members are in an 'Account Disabled' state with no access to any of the products in my tenant. For ten years, we've used the approach to deactivate those who leave our organization instead of deleting their Atlassian account. Is this possibly why they'll continue to be attached to this project role? I just tested this integration again and still get these terminated members in the message.

You're a stellar member of this community, David, and I want to applaud you for a great product and always fast service and helpful advice;-). 

-Paul

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 22, 2021

@Paul Alexander ,

JMWE uses the official Jira REST API to retrieve the list of role members. The problem is that these users still belong to the project role in your project, even after being deactivated, but Jira is not showing them on the "People" tab because they are deactivated. And the Jira REST API that returns project role members doesn't return any indication that these users are disabled.

The only way to remove these users from the project roles is to reactivate them, remove them from project roles, and then deactivate them again.

Another solution is to use Jira's REST API to remove these users from the project roles: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-project-role-actors/#api-rest-api-2-project-projectidorkey-role-id-delete

I have reported the problem to Atlassian: https://ecosystem.atlassian.net/browse/ACJIRA-2342. But I don't expect a resolution anytime soon.

Paul Alexander
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 Leaders.
March 23, 2021

David, I reactivated the worker and still see that he does not belong to any groups or any project roles in any of my jira projects. I then deactivated him again but still he is included in the notification.

When doing a get request for roles in one of my projects I do get Lisa Simpson returned even though she is not attached to that role. Thanks for posting a bug for them though.

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 23, 2021

Paul,

after reactivating the user, you need to wait a little before going to the People page of your project. It takes a little time for Jira to synchronize with user management.

If it doesn't work, you should contact Atlassian support.

Suggest an answer

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

Atlassian Community Events