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

How to add multi-line "Work Description" using CLI?

SOLVED
Highlighted
Newbie

How to add multi-line "Work Description" using CLI?

I try to add multi-line "work description" using command line interface?

Similar to the follwong:

im editissue --field="Work Description"="Hello\nThank"?

It seems to me that \n does not create and line feed.

Also can we add file from content in a file?

Thank you

Tags (1)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to add multi-line "Work Description" using CLI?

This also works:

im editissue --field='Comments=Adding new lines^

Line1^

Line2' 123456

Note: Double quote (") is replaced with single quote (')

Balu

View solution in original post

13 REPLIES 13
Highlighted

Re: How to add multi-line "Work Description" using CLI?

You have to escape with ^.

Replace \n by ^\n.

HTH

Highlighted

Re: How to add multi-line "Work Description" using CLI?

Thank you for the reply.

But it does not work very well.

When I run this command:

im editissue --field="Work Description"="Line1^\n Line2" 6210729

On Integrity web client, it still shows like this:

[izhang, 31-Oct-2012 9:50:36 AM EDT]

Line1\n Line2

Any more suggestion? Thanks in advance.

Highlighted

Re: How to add multi-line "Work Description" using CLI?

This is just off the top of my head and hasn't been tested, but have you tried " \r\n "?

Highlighted

Re: How to add multi-line "Work Description" using CLI?

Thank you for the reply.

I tried. But it does not work.

im editissue --field="Work Description"="Line1\r\n Line2" 6210729

im editissue --field="Work Description"="Line1^\r^\n Line2" 6210729

Both do not work.

[izhang, 31-Oct-2012 11:21:36 AM EDT]

Line1\r\n Line2

[izhang, 31-Oct-2012 11:21:17 AM EDT]

Line1^\r^\n Line2

Highlighted

Re: How to add multi-line "Work Description" using CLI?

Ok, can I get you to try " <br> "?

So, im editissue --field="Work Description"="Line1<br> Line2" 6210729

I know this works with certain triggers.

Highlighted

Re: How to add multi-line "Work Description" using CLI?

I have in some old script to replace \n by ^\n\n. (this was workgin with MKS2009)

I don't remember why I've doubled the \n.

Maybe it still works?

Highlighted

Re: How to add multi-line "Work Description" using CLI?

Hello,


I believe Ian was attempting to use a PERL script to call the Integrity CLI command:

The following example code worked in our internal environment:

**** Example, Editing Item 860 - Adding multi values to a regular text field *****

#!/usr/bin/perl

$ID=860;

my $WorkDesc="Line1\nLine2\nLine3";

print "Editing item - Adding multiple lines\n";

my $mks_cmd="im editissue --field='Multival'='$WorkDesc' $ID";

system($mks_cmd);

print "Done\n";

*****************

Regards,

Dragan

Highlighted

Re: How to add multi-line "Work Description" using CLI?

If "Work Description" is a rich longtext field, you can use the "im editissue --richContentField=field=value" command. As Jeremy pointed out with <br>, rich content fields are HTML format.

Highlighted

Re: How to add multi-line "Work Description" using CLI?

Thank you for all the reply.

"Work Description" is not a rich text filed. Therefore, <br/> does not work.

I talked to PTC Integrity tech support yesterday and this morning. Currently they do not support this. They will create an RFC for this feature.

I have to use Java API for this.

Thanks.

Highlighted

Re: How to add multi-line "Work Description" using CLI?

Below script has worked for me:

(set LF=^

)

setlocal EnableDelayedExpansion

im editissue --field="Comments=Adding new lines!LF!Line1!LF!Line2" 123456

Hope this helps.

Balu

Highlighted

Re: How to add multi-line "Work Description" using CLI?

This also works:

im editissue --field='Comments=Adding new lines^

Line1^

Line2' 123456

Note: Double quote (") is replaced with single quote (')

Balu

View solution in original post

Highlighted

Re: How to add multi-line "Work Description" using CLI?

Thank you, Balu. I've retried with your hint (replacing " with ') and it works now for me with Integrity 10.2

Highlighted

Re: How to add multi-line "Work Description" using CLI?

When i tried with same CLI, both the lines updating in single line.

Announcements