It's all about the answers!

Ask a question

How do I get the GUID when submitting a new asset?


Andy Jewell (24236274) | asked Oct 24 '13, 6:59 p.m.
edited Oct 25 '13, 1:15 p.m. by Rich Kulp (3.6k38)
<Administrator> Question changed to what turned out to be the real question. The answer is for the real question</Administrator>

Sorry for the newbie question but I'm not sure how this is supposed to work.  I successfully uploaded an asset to RAM using the custom ant library but now I need the URL to that same asset.  It seems pretty straightforward: http://ramserver/ram/oslc/assets/<guid>/<version>.  The problem is, how do I get the GUID!

I have this:

    <ram:search server="ramServer"
            community="${ram.asset.community}"
            version="${ram.asset.version}"
            name="${ram.asset.name}"/>

The query is simple because I know the name is unique.  It runs successfully but there are no results anywhere.  Are the results loaded into a certain property or. . .?

Thanks for any suggestions!

- Andy

Comments
Andy Jewell commented Oct 24 '13, 7:00 p.m.

Sorry with that post, somehow the snippet got mangled.  Try this:


<ram:search server="ramServer"
  community="${ram.asset.community}"
  version="${ram.asset.version}"
  name="${ram.asset.name}"/> 

Accepted answer


permanent link
Rich Kulp (3.6k38) | answered Oct 25 '13, 10:49 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
edited Oct 25 '13, 10:50 a.m.
First off, indexing occurs in the background. This means it can take 30 seconds to a minute before an asset's changes show up in a search result.

Second, you don't need to search to get the guid. When the submit occurs you can have an ANT property set with the guid of the new asset. See Submit task and look at the "guidProperty" setting on the submit.
Andy Jewell selected this answer as the correct answer

Comments
Andy Jewell commented Oct 25 '13, 11:22 a.m.

Well, that's just ideal:)  But could you help with one follow-up question?  I'm publishing the asset using the same task as is used in the ramPublishAsset.xml file (from the ramclient.zip and referenced in Carlos Ferreira's RAM/ant tutorial) and it actual uses ram:modify rather than ram:submit.  It also has that guidProperty.  I just tried it, it does exactly what you said which is exactly what I needed.  Is there any reason to use ram:modify rather than ram:submit or vice versa when publishing a new asset?


Andy Jewell commented Oct 25 '13, 11:26 a.m.

 P.s. . . I ran my same search that I referred to in the OP and I still don't get any results.  Though your answer meets my need (thank you!), for future generations could you help with the original ram:search question so that we have an answer to that on the same thread?  Or if you could modify the question to "How do I get the GUID when submitting a new asset?" then I can submit the ram:search question separately.


1
Rich Kulp commented Oct 25 '13, 1:00 p.m.
FORUM MODERATOR / JAZZ DEVELOPER

Modify is for modifying an existing asset. Submit is only for creating a new asset.

You can't modify an asset with submit and you can't create an asset (other than a new version of an existing asset, leaving the existing asset version still existing after the create new version) with modify.

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.