Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Getting PermissionDeniedException while creation of work item for follow up action

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

0 votes



One answer

Permanent link
 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.........

0 votes

Comments

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

 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.

1 vote

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

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 6,122

Question asked: Nov 16 '16, 2:05 a.m.

Question was seen: 1,665 times

Last updated: Nov 16 '16, 8:10 a.m.

Confirmation Cancel Confirm