![]() |
Telelogic SYNERGY (steve huntington) | ![]() |
Topic Title: How to add an attribute and value to a CR Topic Summary: Created On: 18-Oct-2007 18:32 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
I am attemping to copy attributes from one CR to another through a Perl trigger.
I am able to get the attribute value from the source, but when I issue the following command: my $targetProblem = $csapi->AttributeModifyCRData($user, $problem_number, $targetAttr); for my target CR, I receive the following error message: 06:24:56 10/18/2007 The fault code: 4 06:24:56 10/18/2007 The fault string: CsAPI: PreCRAttrModify: Unknown Error: com.telelogic.cs.util.CsApiException: CsAPI: PreCRAttrModify: Failed to retrieve attribute value Using the CLI, I queried fro the target CR and discovered it did not have the attribute defined in the $targetAttr variable, application. The Show Dialog for this CR has application listed as an attribute, however it is defined as read only. State security allows a user with the developer role modify access to the application attribute. If this problem is not due to the Show Dialog or State Security is there another API command I can use that would add the attribute to my CR and also populate the value? All suggestions welcomed! ------------------------- Angela Kim |
|
![]() |
|
![]() |
|
What user are you using in your script? You may want to use a user like ChangeAdmin.
------------------------- Thanks, Brian |
|
![]() |
|
![]() |
|
Thanks Brian!
Just a basic user with the developer role. To use ChangeAdmin instead, when I create the user object would I just simply pass in ChangeAdmin instead of the current $trigger->get_user(), where $trigger is my TriggerParser object? ------------------------- Angela Kim |
|
![]() |
|
![]() |
|
You could do this but you will over ride all security that is setup on your lifecycle. If this is to be modified by all users then you may want to open up the application attibute instead of using ChangeAdmin. Also the ChangeAdmin password will be stored in this trigger.
------------------------- Thanks, Brian |
|
![]() |
|
![]() |
|
"open up" - do you mean to remove the read-only property from the application attribute on the Show Dialog?
Using ChangeAdmin temporarily would be an interesting test to see if the trigger will even fire... ------------------------- Angela Kim |
|
![]() |
|
![]() |
|
Angela,
A thought, that may or may not be relevant: I am not up to speed with the Perl interface, but
b) in the Command Line Interface there are separate commands to create and modify attributes, so there should also be separate Perl commands. c) In the CLI, there is an option on create to make it work like a modify if the attribute already exists, so there ought to be something similar in the Perl interface Mike. |
|
![]() |
|
![]() |
|
And I am looking for a way to do that from within the API.
I found the following method csapi::CreatObjectAttributes, which has 3 parameters. I am now stumped on how to get the CR's cv id. Anyone know the answer? I am a newbie to the CS API, but am working through it... Thanks for any assistance! ------------------------- Angela Kim |
|
![]() |
|
![]() |
|
Hello Angela,
Try whith this lines in your perl scripts: #Create a new TriggerParser object, passing in the location of the trigger xml document. #The trigger xml document is always the last parameter. my $trigger = new ChangeSynergy::TriggerParser($ARGV[-1]); # Get the CR ID. my $problem_number = $trigger->get_object_id(); #Get all the attributes from the trigger file. my %trigger_attributes = $trigger->get_attributes(); I hope this help you Manuel |
|
![]() |
Telelogic SYNERGY
» SYNERGY/Change
»
How to add an attribute and value to a CR
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.