It's all about the answers!

Ask a question

How to get guid after I submit a new asset?

qiu saphen (27126039) | asked Aug 10 '11, 10:56 p.m.
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?

3 answers

permanent link
Gili Mendel (1.8k56) | answered Aug 11 '11, 10:39 a.m.
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:modify server="ramServer">
<ram:search name="${}" version="${ram.asset.version}" />
<ram:asset id="assetID">

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

permanent link
Eric Bordeau (27632) | answered Aug 11 '11, 10:53 a.m.
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">


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

permanent link
qiu saphen (27126039) | answered Aug 11 '11, 11:21 a.m.
Thank you all!
It is much useful!

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.