It's all about the answers!

Ask a question

Can't upload attachments.

Manuel Felipe Amaya (1321227) | asked Aug 03 '15, 2:07 p.m.

When trying to upload attachments in a WI that has the attribute "Filed Against" assigned to a category that is related to a Team Area, the attachment fails to get uploaded.

I have some preconditions and follow ups (I extended the functionality) at the workitem save operation.

Please help me identifying the mistake I´m incurring into.
Thank you.

2 answers

permanent link
Ralph Schoon (62.9k33645) | answered Aug 03 '15, 2:37 p.m.
edited Aug 03 '15, 2:38 p.m.
Create a new role for the uset that uploads. Disable all operational behavior for that role. Upload and enable one behavior at a time.

If you are unable to provide the details, that is the only way.

Eben the Plain Java Client Libraries can print exceptions that appen due to preconditions.

Manuel Felipe Amaya commented Aug 03 '15, 3:41 p.m. | edited Aug 03 '15, 3:46 p.m.

Thank you for your fast response.

I did as you recommended and found that it doesn't matter if there is just one extension or many, with every one of them the problem is happening.

I failed to tell the last time that this is only happening in the web client. In the eclipse client the workitem save operation works ok.

I'm currently running more tests in the jetty server.

Ralph Schoon commented Aug 04 '15, 2:08 a.m. | edited Aug 04 '15, 2:09 a.m.

You also failed to provide the error message you see, which is the minimum needed to have any hope to help you.
Also, is it any user or just you, is it any browser? Did you delete the browser history?

permanent link
Manuel Felipe Amaya (1321227) | answered Aug 05 '15, 12:21 p.m.
edited Aug 05 '15, 12:22 p.m.

Finally found what was wrong with the extensions.
First the response to your questions:
  • It didn't show the error on the web client, which is where the problem happened.
  • It happened at every browser.
  • I did delete browser history and cache.

The problem was that attachments also trigger the WorkItemSave operation when created. It seems that they behave as WI for some things but not for others.

I added the following line of code after validating the operation of every extension:

if (saveParameter.getNewState() instanceof IWorkItem) {

Maybe it should be added to the extensions workshop as we made some test with that plugin in order to understand what we did wrong and it also happened.

Thank you

Ralph Schoon commented Aug 05 '15, 12:43 p.m. | edited Aug 05 '15, 12:49 p.m.

The workshop does that test for all relevant cases in its context.

If you upload an attachment to a work item in a participant, you have to save it - which triggers the operation behavior again - for the work item you upload to. You can see a description for how to deal with that here see additional save parameters.

Your answer

Register or to post your answer.