Command line query output format shows different results

41 views
Skip to first unread message

Devendra

unread,
Sep 1, 2015, 12:03:08 PM9/1/15
to Synergy CM Tool
When I run same query within Change tool and from coommand line query, it shows dittent output format for user accounts.
 
For example:
 
Query: (cvtype='problem') and (cr_Lifecycle_type='Change Report')"
 
shows below output for filed "cr_Lead_Engineer", (When run from query page within Change tool.)
“David, Patel (aaehekb)”
 
but, command line query (I am running on Linux server where application is installed.
(cvtype='problem') and (cr_Lifecycle_type='Change Report')" -f '%problem_number,"%problem_synopsis",%crstatus,%cr_Lead_engineer'
 shows folloing out put for "cr-Lead_engineer"
"aaehekb"
 
Not sure where does login account to user first name/Last name conversion takes place. Is it from RDS?
 
-Devendra

Ritesh Nigam

unread,
Sep 1, 2015, 12:11:28 PM9/1/15
to synergy...@googlegroups.com

Devendra
It is Change application which creates the user name format, by fetching user's full from RDS, but CLI query shows what exactly is stored in database without applying any format, that's why this difference.

--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to synergy-cm-to...@googlegroups.com.
To post to this group, send email to synergy...@googlegroups.com.
Visit this group at http://groups.google.com/group/synergy-cm-tool.
For more options, visit https://groups.google.com/d/optout.

Devendra Patel

unread,
Sep 3, 2015, 12:09:41 PM9/3/15
to synergy...@googlegroups.com

Is there anyway to call RDS from command line to do same trick?

You received this message because you are subscribed to a topic in the Google Groups "Synergy CM Tool" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/synergy-cm-tool/5PKWyMtRijk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to synergy-cm-to...@googlegroups.com.

Dennis Sybesma

unread,
Sep 3, 2015, 2:33:48 PM9/3/15
to synergy...@googlegroups.com
Hi Devendra,
While I am not aware of any way to get this directly from  RDS via the CLI. You can accomplish this using the CSAPI via a perl script.

I found the following in my bag of tricks that should help.

Dennis.



#!/usr/bin/perl

#Include the Rational Change csapi module.
use ChangeSynergy::csapi;

my $changeURL="http://<url>:<port#>/change";
my $adminUser="admin";
my $adminPassword="admin";

# user to get preferences for
my $userUserID="dennis";

my $dbPath="/ccmdb/base7210";

print "Change URL " . $changeURL . "\n";
print "Database " . $dbPath . "\n";

#Create a new instance of the csapi object.
my $csapi = new ChangeSynergy::csapi();

#Eval block is used for error handling.
eval
{
        #Setup the connection parameters for connecting to the Rational Change Server.
        #Note however that no connection to the server is made at this point.

        $csapi->setUpConnection($changeURL);

        #Login to the ChangeSynegy server. (user, password, role, database);
        my $aUser = $csapi->Login($adminUser, $adminPassword, "Admin", $dbPath);

        my $tmp = $csapi->GetUserPreference($aUser, $userUserID, "user_first_name");
        my $firstName = $tmp->getResponseData();

        my $tmp = $csapi->GetUserPreference($aUser, $userUserID, "user_last_name");
        my $lastName = $tmp->getResponseData();

        my $tmp = $csapi->GetUserPreference($aUser, $userUserID, "user_email");
        my $emailAddress = $tmp->getResponseData();

        print "User $userUserID full name: $firstName $lastName, email address: $emailAddress \n";

};

#If any errors occurred, print them to the screen.
if ($@)
{
        print $@;

Matthias.Sc...@materna.de

unread,
Sep 4, 2015, 2:59:47 AM9/4/15
to synergy...@googlegroups.com
Hi Devendra,

if using the Perl API is no option for you (but I would prefer this way) an other possibility is to do the RDS lookup afterwards by yourself using "ldapsearch" (if you have openldap-tools - or is it openldap-utils? - or similar installed on your box).

Regards,
Matthias

-----Ursprüngliche Nachricht-----
Von: synergy...@googlegroups.com [mailto:synergy...@googlegroups.com] Im Auftrag von Dennis Sybesma
Gesendet: Donnerstag, 3. September 2015 20:34
An: synergy...@googlegroups.com
Betreff: Re: Command line query output format shows different results
On Sep 1, 2015 11:11 AM, "Ritesh Nigam" <ritesh...@gmail.com <mailto:ritesh...@gmail.com> > wrote:
Devendra
It is Change application which creates the user name format, by fetching user's full from RDS, but CLI query shows what exactly is stored in database without applying any format, that's why this difference.

On Sep 1, 2015 9:33 PM, "Devendra" <devendra...@gmail.com <mailto:devendra...@gmail.com> > wrote:
When I run same query within Change tool and from coommand line query, it shows dittent output format for user accounts.

For example:

Query: (cvtype='problem') and (cr_Lifecycle_type='Change Report')"

shows below output for filed "cr_Lead_Engineer", (When run from query page within Change tool.)
“David, Patel (aaehekb)”

but, command line query (I am running on Linux server where application is installed.
(cvtype='problem') and (cr_Lifecycle_type='Change Report')" -f '%problem_number,"%problem_synopsis",%crstatus,%cr_Lead_engineer'
shows folloing out put for "cr-Lead_engineer"
"aaehekb"

Not sure where does login account to user first name/Last name conversion takes place. Is it from RDS?

-Devendra
--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to synergy-cm-to...@googlegroups.com <mailto:synergy-cm-to...@googlegroups.com> .
To post to this group, send email to synergy...@googlegroups.com <mailto:synergy...@googlegroups.com> .
Visit this group at http://groups.google.com/group/synergy-cm-tool <http://groups.google.com/group/synergy-cm-tool> .
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout> .
--
You received this message because you are subscribed to a topic in the Google Groups "Synergy CM Tool" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/synergy-cm-tool/5PKWyMtRijk/unsubscribe <https://groups.google.com/d/topic/synergy-cm-tool/5PKWyMtRijk/unsubscribe> .
To unsubscribe from this group and all its topics, send an email to synergy-cm-to...@googlegroups.com <mailto:synergy-cm-to...@googlegroups.com> .
To post to this group, send email to synergy...@googlegroups.com <mailto:synergy...@googlegroups.com> .
Visit this group at http://groups.google.com/group/synergy-cm-tool <http://groups.google.com/group/synergy-cm-tool> .
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout> .

--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to synergy-cm-to...@googlegroups.com <mailto:synergy-cm-to...@googlegroups.com> .
To post to this group, send email to synergy...@googlegroups.com <mailto:synergy...@googlegroups.com> .
Visit this group at http://groups.google.com/group/synergy-cm-tool <http://groups.google.com/group/synergy-cm-tool> .
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout> .




--
You received this message because you are subscribed to the Google Groups "Synergy CM Tool" group.
To unsubscribe from this group and stop receiving emails from it, send an email to synergy-cm-to...@googlegroups.com.
To post to this group, send email to synergy...@googlegroups.com <mailto:synergy...@googlegroups.com> .
Reply all
Reply to author
Forward
0 new messages