It's all about the answers!

Ask a question

Is there a plugin available for CopyWorkItem?

Susan Hanson (1.6k2201194) | asked Jan 02 '14, 10:21 p.m.
Has anyone seen this and is this a bug?
We have custom work item types and restrict the save permissions on a few custom attributes to a specific role. However, if you do a COPY of the work item and that value is selected, then the save permissions don't seem to be taking effect.  We have specific cases where the work item was copied (which we see in the history) which includes the saving of attributes that the person who copied the work item does *NOT* have permissions to change. 

So a) Is this a bug?
If not, then is there something we can do to alleviate this issue?

When you do a CopyWorkItem (like from the Eclipse client), it prompts you to select the attributes to be copy the values of into the new work item.  It looks like the work item attributes that are available for selection (or de-selection) are attributes other than Summary and Description that have been modified in the original work item that is being copied (including custom attributes).  We need a way to *NOT* allow the values of certain attributes to be copied.  Is it possible:
      a) using some indication/parameter/option on the attribute itself within that work item?
      b) using a plugin that we could write to insert logic either between the copy action and the popup (to tell the pop-up what NOT to include) or between the popup and the display of the new uninitialized work item?


sam detweiler commented Jan 03 '14, 12:37 a.m. | edited Jan 03 '14, 12:38 a.m.

because the copy operation creates a NEW workitem, the builtin 'save' constraints are not used. the user doing the copy has READ permission on the custom attributes, so I don't think there is any mechanism to exclude them from selection.
I don' think you can override the copy UI.

you might be able to remove them from the copy list, I think copy uses the lightweight editor presentation. so you could define another one for that  workitem type.  but you can't make it role sensitive.

you should be able to write a plugin to prevent the save however..

Susan Hanson commented Jan 24 '14, 12:50 a.m.

Does anyone know of an operationId that can hook into with an OperationAdvisor?  I'd like to do an advisor on the CopyWorkItem operation so that I can check the work item type and not allow any copy of this custom WorkItem.

I've checked into if it is the lightweight editor presentation but I already have this defined for this custom work item and the specific attributes that i do NOT want to copy are not in my lightweight editor.   It is the pop-up dialog where you select which attributes to include in the copy.  It seems like it puts in everything that is filled in (not the default values).  So if I copy work item 1 and it does NOT have that attribute with a value, it is not in the attribute list to copy.  If it DOES have a value, then it is in the list.  This is my issue, I need to somehow state that this specific attribute should NOT be eligible for copying to a new work item.  If I can't do this, then I need to restrict copying the work item type in general.


Be the first one to answer this question!

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.