It's all about the answers!

Ask a question

Creating an Asset with multiple owners?


Chris Graham (367814) | asked Nov 17 '11, 11:49 p.m.
Hi All.

How we do we this?

I can be done in the web gui, but I can not work out how to do it from script.

This is what I have so far. The issue with it is that it creates the Asset with the owner set to the second one. Not the first.


<ram>
<ram>
<ram>
<ram>DR ${release.name}-${release.version}_${environment.name}</ram>
<ram>${release.version}</ram>
<ram>Deployment</ram>
<ram>Deployment Record</ram>
<ram>Deployment Request for ${release.name}-${release.version} into ${environment.name}</ram>
<ram>Deployment Request for ${release.name}</ram>
<Add>
<Is>
<These>
<ram>
<ram>${ram.asset.owner}</ram>
</ram>
<ram>
<ram>${ram.asset.additional.owner}</ram>
</ram>
<ram>
<ram>All</ram>
</ram>
<Create>
<ram>
<ram>
</ram>
<ram>
<ram>
</ram>
</ram>
</ram>


-Chris

4 answers



permanent link
Chris Graham (367814) | answered Nov 17 '11, 11:49 p.m.
hate that.


<ram:modify server="ramServer">
<ram:search query="name:(DR ${release.name}-${release.version}_${environment.name}) version:(${release.version})" />
<ram:asset>
<ram:name>DR ${release.name}-${release.version}_${environment.name}</ram:name>
<ram:version>${release.version}</ram:version>
<ram:community>Deployment</ram:community>
<ram:assetType>Deployment Record</ram:assetType>
<ram:description>Deployment Request for ${release.name}-${release.version} into ${environment.name}</ram:description>
<ram:shortDescription>Deployment Request for ${release.name}</ram:shortDescription>
<!-- Add in extra, custom, mandatory attributes. -->
<!-- Is a build fails due to wierd errors - check the values here. -->
<!-- These values are mostly sourced from settings.xml -->
<ram:attribute name="Owner">
<ram:value>${ram.asset.owner}</ram:value>
</ram:attribute>
<ram:attribute name="Owner">
<ram:value>${ram.asset.additional.owner}</ram:value>
</ram:attribute>
<ram:attribute name="Deployment Type">
<ram:value>All</ram:value>
</ram:attribute>
<!-- Create needed references -->
<ram:relatedAsset type="Deployment of">
<ram:asset guid="${releaseAssetGUID}" />
</ram:relatedAsset>
<ram:relatedAsset type="Hosted By">
<ram:asset guid="${environmentAssetGUID}" />
</ram:relatedAsset>
</ram:asset>
</ram:modify>

-Chris

permanent link
Rich Kulp (3.6k38) | answered Nov 18 '11, 2:08 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
You can't set owners of an asset through the ANT tasks. Owner isn't a
attribute. The submitter is the owner.

Rich

permanent link
Chris Graham (367814) | answered Nov 20 '11, 6:16 p.m.
Not quite what I asked.
Actually it does work, as when I specified someone else, someone other than (me) the user who logged on, they were recorded as the Asset owner.
So I take it we can not add additional owners, like we can through the GUI?
-Chris
You can't set owners of an asset through the ANT tasks. Owner isn't a
attribute. The submitter is the owner.

Rich

permanent link
Rich Kulp (3.6k38) | answered Nov 21 '11, 1:23 p.m.
FORUM MODERATOR / JAZZ DEVELOPER
On 11/20/2011 6:23 PM, chrisgwarp wrote:
Not quite what I asked.
Actually it does work, as when I specified someone else, someone other
than (me) the user who logged on, they were recorded as the Asset
owner.

I don't see how that is possible. Maybe someone created an attribute
called Owner on their own, and that is what you see. But RAM doesn't use
any attribute by the name of Owner to set the official Asset Owners.
I've looked at the code and it just doesn't do that.

If you or some administrator on your system had created a multi-valued
Owner attribute then you should be able to have more than one. But if
your administrator created it as single valued then only one could be set.

Also, this is not the correct way to set a multi-valued attribute:
<ram>
<ram>${ram.asset.owner}</ram>
</ram>
<ram>
<ram>${ram.asset.additional.owner}</ram>
</ram>

To do a multi-value use:

<ram>
<ram>${ram.asset.owner}</ram>
<ram>${ram.asset.additional.owner}</ram>
</ram>

But I must stress this won't set the official Asset Owners. It will only
set a multi-valued attribute that someone just happened to call Owner.
--
Rich Kulp
Rational Asset Manager developer

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.