It's all about the answers!

Ask a question

IProcessArea.addMember() and IProcessArea.addRoleAssignments abnormal result


Yung-Hsiang Chan (34613) | asked Dec 10 '14, 9:38 p.m.
edited Dec 10 '14, 9:40 p.m.
Hi.

After I removed all the members in the IProcessArea, I tried to add them back.
So I iterated to add each member back by calling IProcessArea.addMember().

But the result is weird. The roles of member is not empty. Some roles are assigned to this member instead.

Are roles cached somewhere?

When I called IProcessArea.addRoleAssignments(), the result is not like I thought.
I want to add role A to John. But in the end, John has no role.

The history shows John has been assigned A and A has been removed at the same time.
(It's because John has been assigned A since IProcessArea.addMember())

But there is another problem. Why IProcessArea.addRoleAssignments() removed roles from members?

I then use  IProcessArea.setRoleAssignments() to solve this problem instead. 

Am I misunderstanding the API document?

Thanks!

7 answers



permanent link
sam detweiler (12.4k6172200) | answered Dec 10 '14, 9:56 p.m.
after you removed the users, you did a save on the process area, right?
THEN you can add them back...

permanent link
Yung-Hsiang Chan (34613) | answered Dec 10 '14, 10:10 p.m.
edited Dec 10 '14, 10:16 p.m.
I do save the process area after I remove the members.

I even tried remove members on the website instead using api.

But the result is the same.


(I used version 4.0.2 API)

Comments
sam detweiler commented Dec 10 '14, 10:24 p.m.

website?  you mean thru the web UI of your RTC installation?


Yung-Hsiang Chan commented Dec 10 '14, 10:38 p.m.

yes.


The "History" shows only "add member" but not "add role" action.

The process I used:

1. remove members -> Save
2. add members -> Save
3. add roleassignment -> Save


permanent link
sam detweiler (12.4k6172200) | answered Dec 10 '14, 10:48 p.m.
edited Dec 10 '14, 10:49 p.m.
in my history I see , this is 4.0.6

Change by sam (Jun 23, 2014 4:47 PM)

Members
added:
    sam
Role assignments
sam
added:
    Team Member
    Stakeholder
    Scrum Master
    Product Owner
just added new user to system and
Change by sam (Dec 10, 2014 9:48 PM)

Members
added:
    tom
Role assignments
tom
added:
    Scrum Master
    Team Member

permanent link
Yung-Hsiang Chan (34613) | answered Dec 10 '14, 11:28 p.m.
edited Dec 10 '14, 11:29 p.m.
  
Below are the results after addMember and addRoleAssignment, where the first one "Remove a role". (4.0.2)

Change by admin (2014/12/9 下午3:54)

Role assignments
john
added:
    jazz_role_sdjazz_role_developer
removed:
    SD
Change by admin (2014/12/9 下午3:54) 

Members
added:
    john


Below is the right result. (4.0.2)

Change by admin (2014/12/9 下午3:54)

Role assignments
royce
added:
    Reviewer
Change by admin (2014/12/9 下午3:54)

Members
added:
    royce


Below does not show "role assignment" history. (4.0.2)

Change by admin (2014/12/9 下午3:54)

Members
added:
    joyce


The results are from the same code and during the same execution.


permanent link
Hakki Bozkurt (1631021) | answered Dec 11 '14, 1:40 a.m.

Hi yung,

Maybe u try to add team area, just like this:

...

urTeamArea.addMember(userContributor);

urTeamArea.setRoleAssignments(userContributor,new IRole[] {role});

...


permanent link
Ralph Schoon (55.3k23642) | answered Dec 11 '14, 3:21 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
I would suggest to look into http://rsjazz.wordpress.com/2013/09/18/deploying-templates-and-creating-projects-using-the-plain-java-clients-library/ which adds users and role assignments.

permanent link
Yung-Hsiang Chan (34613) | answered Dec 14 '14, 7:35 p.m.
edited Dec 14 '14, 7:36 p.m.
yeah, I used setMember(userContributor) in the end but still don't know why I got weird results by using addMember(userContributor).

Perhaps I should use 4.0.6.

Thank you all!

Your answer


Register or to post your answer.