cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Using CLI Command to add hyperlink to a specific item?

cmelhem
1-Visitor

Using CLI Command to add hyperlink to a specific item?

Hello,

I just tried the following command:

im editissue --hostname=hostname.net --port=7001 --richcontentField=RQ_Text="<a href=\"http://hostname.net:7001/siro/viewrevision?projectName=%2%Programs%_selection=test.xml\">XML File</a>" 21020

But it doesn't work well. The created Hyperlink could not be opened.

In Addition I need to select a specific Version of the XML file. So I Need to add the Parameter "Revision" but how?

Thanks

C.

5 REPLIES 5

The syntax you used for the example link looks wrong. It should be something like this:

http://hostname.net:7001/si/viewrevision?projectName=/Path_To_Project/project.pj&selection=test.xml

Note that you should use the whole project name, not URL-encode the "/" characters, and use the "&selection=" separator.

I used "_" for legibility; if I had spaces in the names I'd replace them with %20 (that applies to other special characters of course).

You can add "&revision=" for a specific file revision.

mrump
16-Pearl
(To:LLawton)

When using a DOS Shell for example you have to Keep in mind that the '&' is a special character.

So you will need the escape character '^&' as well

Hello Charbel Melhem‌,

I already experienced the same issue. It was bug in PTC. Please refer the article "CS114886" for more information.

The workaround which worked for me is, just replaced the "hostNAME" with "IP Address". This worked as expected. For example, replace "hostname.ne" with "ip address" (may be: 10.38.30.20 something like that).

"http://10.38.30.20:7001/siro/viewrevision?projectName=%2%Programs%_selection=test.xml". This worked for me.

One more hint:

1. Just add the hyperlink in Integrity

2. Then execute "im issue" command to look how its stored in database.

3. Then execute in an similar way.

Regards,

Sathish

dthierjung
12-Amethyst
(To:cmelhem)

Hi Charbel Melhem

to insert a clickable link you need to add

    <!-- MKS HTML -->

at the beginning of your field.

This should work:

im editissue --hostname=hostname.net --port=7001 --addFieldValues=RQ_Text="<!-- MKS HTML --><a href=\"http://hostname.net:7001/siro/viewrevision?projectName=%2%Programs%_selection=test.xml\">XML File</a>" 21020

There is a note in the CLI reference concerning --richContentField:

"In the Windows command line interface (cmd.exe), the ^ escape character must precede the < and > characters in HTML tags, for example, ^<b^>Feature Overview^</b^> ."

Maybe you could also try this (in combination with <!-- MKS HTML -->

Regards,

Dominik

You can review the given scripts by PTC i.e. emailAdvanced.js where they have embedded hyperlinks back to specific items.

Announcements


Top Tags