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

Check if attachment is null in javascript

 Hi , 

 

I created a new workitem.

In the editor presentation i defined attachments under the tab links , the attachment ID is:

com.ibm.team.workitem.presentation.attachments

I want to create a java script  that will check if the attachment is null or contain any value (I don't care which value it contain).

Is it possible ? (According to https://jazz.net/forum/questions/157309/how-to-get-attachment-file-name- of-a-work-item-in-a-customized-attribute ,  you can't access the attachments collection from JavaScript)

If it's possible in java script , how can i do it ? 

 

BR,

Chen

0 votes


Accepted answer

Permanent link
For all I know you can not access attachments in JavaScript. Carefully read the description of what data you can access in JavaScript. You basically have access to specific work item attributes and attachments are not an attribute, really.
Chen Ben ezra selected this answer as the correct answer

0 votes

Comments

Thanks :)


One other answer

Permanent link

you can try this:

    workItem.getProxy().storedObject.linkTypes[0].linkDTOs.length

0 votes

Comments

Thanks. But note that this is internal, not supported API. It also likely does not work in the Eclipse client.

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

Question asked: Dec 10 '15, 5:44 a.m.

Question was seen: 2,363 times

Last updated: Jul 05 '24, 9:59 a.m.

Confirmation Cancel Confirm