Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic SYNERGY (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 18-Oct-2007 18:32
User is offline View Users Profile Print this message


Angela Kim

Posts: 29
Joined: 23-Oct-2003

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
Report this to a Moderator Report this to a Moderator
 18-Oct-2007 18:38
User is offline View Users Profile Print this message


Brian Barde

Posts: 39
Joined: 24-Sep-2004

What user are you using in your script? You may want to use a user like ChangeAdmin.

-------------------------
Thanks,
Brian
Report this to a Moderator Report this to a Moderator
 18-Oct-2007 18:47
User is offline View Users Profile Print this message


Angela Kim

Posts: 29
Joined: 23-Oct-2003

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
Report this to a Moderator Report this to a Moderator
 18-Oct-2007 18:55
User is offline View Users Profile Print this message


Brian Barde

Posts: 39
Joined: 24-Sep-2004

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
Report this to a Moderator Report this to a Moderator
 18-Oct-2007 18:59
User is offline View Users Profile Print this message


Angela Kim

Posts: 29
Joined: 23-Oct-2003

"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
Report this to a Moderator Report this to a Moderator
 18-Oct-2007 21:08
User is offline View Users Profile Print this message


michael Barnes

Posts: 85
Joined: 12-Nov-2003

Angela,

A thought, that may or may not be relevant:
I am not up to speed with the Perl interface, but
    a) Synergy only creates an attribute in the database whan a value is assigned to the attribute.
    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.
Report this to a Moderator Report this to a Moderator
 19-Oct-2007 13:09
User is offline View Users Profile Print this message


Angela Kim

Posts: 29
Joined: 23-Oct-2003

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
Report this to a Moderator Report this to a Moderator
 19-Oct-2007 13:58
User is offline View Users Profile Print this message


Manuel Fernando Rivera

Posts: 12
Joined: 12-Apr-2007

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic SYNERGY forum.
There are currently 2 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 15:34.
There are currently 0 guests browsing this forum, which makes a total of 2 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.