It's all about the answers!

Ask a question

Getting PermissionDeniedException while creation of work item for follow up action


Anurag Patel (2128) | asked Nov 16 '16, 2:05 a.m.
edited Nov 16 '16, 5:50 a.m.
Hi,

I am working on follow up action using server side api to create work and try to create the work item using implementing the Thread in my logic. I implemented the logic and getting the "PermissionDeniedException while creation of work Item".
Same logic is working fine if I remove the Thread from my code.
Could any one know why I I am getting this exception.
Please find below exception details :

item.com.ibm.team.repository.common.PermissionDeniedException: Missing permission to fetch items

        at com.ibm.team.workitem.service.internal.AuditableServer.resolveAuditablesPermissionAware(AuditableServer.java:161)

        at com.ibm.team.workitem.common.internal.WorkItemCommon.createWorkItem(WorkItemCommon.java:247)

        at com.ibm.team.workitem.common.internal.WorkItemCommon.createWorkItem2(WorkItemCommon.java:232)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

        at java.lang.reflect.Method.invoke(Method.java:611)

        at com.ibm.team.workitem.service.internal.ServiceAdapter.invoke(ServiceAdapter.java:75)

        at com.sun.proxy.$Proxy2671.createWorkItem2(Unknown Source)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)

        at java.lang.reflect.Method.invoke(Method.java:611)

        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.invoke(ExportProxyServiceRecord.java:361)

        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord.access$0(ExportProxyServiceRecord.java:347)

        at org.eclipse.soda.sat.core.internal.record.ExportProxyServiceRecord$ExportedServiceInvocationHandler.invoke(ExportProxyServiceRecord.java:56)

        at com.sun.proxy.$Proxy2674.createWorkItem2(Unknown Source)

        at com.fcagroup.pmbd.plugin.CRAutoGenerateWI.DynamicDisciplineTaskCreator.createDiscipline(DynamicDisciplineTaskCreator.java:613)

        at com.fcagroup.pmbd.plugin.CRAutoGenerateWI.DynamicDisciplineTaskCreator.createLevelThreeTreeWI(DynamicDisciplineTaskCreator.java:424)

        at com.fcagroup.pmbd.plugin.CRAutoGenerateWI.WorkItemCreation.run(WorkItemCreation.java:47)

com.ibm.team.repository.common.PermissionDeniedException: Missing permission to fetch items

One answer



permanent link
Ralph Schoon (61.2k33643) | answered Nov 16 '16, 2:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
 Your follow up action runs in the context of the user that performs the operation the follow up action triggers on. 
Your user apparently does not have the permission to resolve the items 

item.com.ibm.team.repository.common.PermissionDeniedException: Missing permission to fetch items 
at com.ibm.team.workitem.service.internal.AuditableServer.resolveAuditablesPermissionAware(AuditableServer.java:161)

Usually the error messages are not far away from the truth.........

Comments
Anurag Patel commented Nov 16 '16, 5:38 a.m.

Hi Ralph,


when I tried the same logic to create the work item by removing the Thread then it is executed properly and work item created without any exception. Is there any limitations with Thread?

Thanks


1
Ralph Schoon commented Nov 16 '16, 6:02 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 The fllow-up actions/Participants run in the database transaction context as far as I can tell, to allow to error and prevent a save. There is also a special Job Model for sever operations. I assume that you would have to conform to that Job model. Don't ask me how it works, though.


Miguel Tomico commented Nov 16 '16, 8:10 a.m.

@anuragpatel153 what's your motivation for using threads in a server-side script?

Your answer


Register or to post your answer.