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

How to get guid after I submit a new asset?

Hi,
I use ant script to submit a new asset, I want to get the guid to combine a url and then use this url to access the asset I just submit.
How can I do that?

0 votes



3 answers

Permanent link
Are you going to use the url from the Ant script?

regardless, here is how you will get the GUID

The following code will create an asset or modify if it is already existing - it also set assetID as a (Ant) reference to it. Note also the <ram:propertyHelper/> ... which helps you to "." introspect.




<ram:server id="ramServer" url="${ram.url}" username="${ram.uid}" password="${ram.password}" />
<ram:propertyHelper/>
<ram:modify server="ramServer">
<ram:search name="${ram.asset.name}" version="${ram.asset.version}" />
<ram:asset id="assetID">
</ram:asset>
</ram:modify>

<echo message="Published: ${assetID.name} [${assetID.version}], GUID=${assetID.GUID}" />

0 votes


Permanent link
Also, with both the <modify> and <submit> tasks, you can use the guidProperty parameter to get the GUID of the asset that was created/modified.

<ram:submit server="ramServer" guidProperty="asset.guid">

<ram:asset>
...
</ram:asset>
</ram:modify>

<echo message="GUID=${asset.guid}" />

0 votes


Permanent link
Thank you all!
It is much useful!

0 votes

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: Aug 10 '11, 10:56 p.m.

Question was seen: 5,539 times

Last updated: Aug 10 '11, 10:56 p.m.

Confirmation Cancel Confirm