Skip to main content
1-Visitor
August 1, 2016
Question

Using CLI Command to add hyperlink to a specific item?

  • August 1, 2016
  • 4 replies
  • 2969 views

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.

    4 replies

    16-Pearl
    August 1, 2016

    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.

    16-Pearl
    August 3, 2016

    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

    11-Garnet
    August 4, 2016

    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

    1-Visitor
    August 5, 2016

    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

    1-Visitor
    August 5, 2016

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