It's all about the answers!

Ask a question

Can not save Work Item due to permission issue

cheng yingying (324) | asked Dec 05 '14, 3:30 a.m.
edited Dec 07 '14, 8:57 p.m.
I'm trying to use RTC Plain JAVA API to create a defect.
I have the permission to create a defect from UI.
But I've got following error when I have set values and save a defect work item.  

Does the following error mean I don't have the permission to create a defect by API? Thanks. : CRJAZ6053E The 'Save Work Item' operation cannot be completed. Permission is required to complete the operation.
      at )
Name: Save Work Item
      Severity: ERROR
            Name: Required Properties
            Severity: OK
            Name: Required Approvals
            Severity: OK
            Name: All Children Resolved
            Severity: OK
            Name: Save Project Area
            Severity: ERROR
                  Summary: Permission Denied
                  Description: You don't have permission to perform the following actions:
  Modify the process specification (modify/specification)
                  Severity: ERROR
                  Name: Avoid saving private roles
                  Severity: OK

sam detweiler replied me in another question.

Looks like you are trying to save the project area.. not just the workitem 


But I believe I'm saving a work item(defect), don't know why it triggered the saveProjectArea. Following is the related code. And I have used the similar code to save a work item(task) successfully. Confused.

Any tips? Thanks a lot.
private static class WorkItemInitialization extends WorkItemOperation {
private String fSummary;
private ICategoryHandle fCategory;
private IIterationHandle fIteration;
HashMap<iattribute, Object=""> fAttributes;
public WorkItemInitialization(String summary, ICategoryHandle category, IIterationHandle iteration, HashMap attributes) {
super("Initializing Work Item");
fSummary= summary;
fCategory= category;
fAttributes = attributes;
fIteration = iteration;
protected void execute(WorkItemWorkingCopy workingCopy, IProgressMonitor monitor) throws TeamRepositoryException {
IWorkItem workItem= workingCopy.getWorkItem();

Iterator keys = fAttributes.keySet().iterator();
IAttribute key = (IAttribute);
Object value = fAttributes.get(key);
workItem.setValue(key, value);

String repositoryURI= "";
String userId= "XXXX";
String password= "YYYY";
String projectAreaName= "Lotus Connections";
String typeIdentifier= "defect";

String summary = "Post install bvt";
String categoryName= "Web/Cross Functional/Automation";//args[6];//filedAgainst
String plannedFor = "Main development/Release Backlog/2014 Development";//required by task, defect
String foundIn = "Automated BVT";//required by defect
String qaTeam = "Functional (FVT)";//required by defect
String phaseFound = "Functional (FVT)";//required by defect
IWorkItemType workItemType= workItemClient.findWorkItemType(projectArea, typeIdentifier, null);
if (workItemType == null) {
System.out.println("Work item type not found.");
return false;

IAttribute phaseAttribute = workItemClient.findAttribute(projectArea, "howfound", null);
Identifier literalID_phase = null;
IEnumeration enumeration_phase =workItemClient.resolveEnumeration(phaseAttribute, null);
List literals_phase = enumeration_phase.getEnumerationLiterals();
for (Iterator iterator = literals.iterator(); iterator.hasNext();) {
ILiteral iLiteral = (ILiteral);
if (iLiteral.getName().equals(phaseFound)) {
literalID_phase = iLiteral.getIdentifier2();
System.out.println("You found phase!!");
System.out.println("not found phase");
return false;
attributes.put(foundInAttribute, foundIN);
attributes.put(qaAttribute, literalID);
attributes.put(phaseAttribute, literalID_phase);

WorkItemInitialization operation= new WorkItemInitialization(summary, category, cih, attributes);
IWorkItemHandle handle=, null);
IWorkItem workItem= auditableClient.resolveAuditable(handle, IWorkItem.FULL_PROFILE, null);
System.out.println("Created work item " + workItem.getId() + ".");

2 answers

permanent link
Brian Fleming (1.6k11928) | answered Dec 05 '14, 1:29 p.m.
I suspect its the Planned For value.  I have seen a similar error when importing workitems that have a Planned For value that does not yet exist in the Project Area.  The work item creation is attempting to add the Planned For value you specify to the project area but is failing because you don't have a role with permission to do that.  Note that children iterations of the out of the box "Main Development" timeline should start with "development/..." not "Main development/..." as you have.
String plannedFor = "development/Release Backlog/2014 Development";//required by task, defect

sam detweiler commented Dec 05 '14, 2:53 p.m.

good catch... I had this problem on import (the extra iterations and categories were created)..  I had admin so no error.

see the actual label string for the iterations.

permanent link
Ralph Schoon (63.2k33646) | answered Dec 05 '14, 5:02 a.m.
I agree with Sam but I am not sure why it happens either.

My suggestion would be to create your own test system where you can modify the permissions, get your code to work and then try it a gain on the current project area and find out what the difference is.

Your answer

Register or 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.