It's all about the answers!

Ask a question

How to get guid after I submit a new asset?


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

3 answers



permanent link
Gili Mendel (1.8k56) | answered Aug 11 '11, 10:39 a.m.
JAZZ DEVELOPER
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}" />


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

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

Your answer


Register or to post your answer.