cancel
Showing results for 
Search instead for 
Did you mean: 

Multilines overview in ccollab admin batch

Highlighted
New Contributor

Multilines overview in ccollab admin batch

I am trying to create a new review while filling the overview custom field with mutiple lines of text. All of my attempts have failed. For example,

 

$ cat b.xml

<batch-commands>

  <global-options>
    <no-browser/>
    <non-interactive/>
    <scm>git</scm>
  </global-options>

  <admin_review_create>
    <title>My Title</title>
    <custom-field>Overview=first line&#10;second line</custom-field>
  </admin_review_create>

</batch-commands>

 

 $ ccollab admin batch b.xml

Parsing commands...

Successfully parsed 1 command

 .

Executing command 'ccollab admin review create'

Setting title to My Title

Setting custom fields...

Setting custom field Overview to second line, first line

ERROR: Executing command `ccollab admin batch`:

Errors found:

[ {

  "result" : { }

}, {

  "result" : { }

}, {

  "errors" : [ {

    "code" : "InternalError",

    "message" : "In Overview: Expected 1 value, but found 2"

  } ]

} ]

 

I am using version 9.3.9300 of the client and server.

 

How can this be achieved ?

5 REPLIES 5
Highlighted
New Contributor

Re: Multilines overview in ccollab admin batch

We have found out that a potential solution is the use the --use-legacy-api option:

 

$ ccollab --use-legacy-api admin batch b.xml

 

Isn't that a bug in in ccollab ? How long will the --use-legacy-api switch be supported ?

 

Benoit

Highlighted
New Contributor

Re: Multilines overview in ccollab admin batch

Hi I have this exact problem but the --use-legacy-api option is not recognized as a valid option for ccollab admin.  Did you get to the bottom of this issues?


@belleyb wrote:

We have found out that a potential solution is the use the --use-legacy-api option:

 

$ ccollab --use-legacy-api admin batch b.xml

 

Isn't that a bug in in ccollab ? How long will the --use-legacy-api switch be supported ?

 

Benoit


 

Highlighted
New Contributor

Re: Multilines overview in ccollab admin batch

This appears not to be possible! I ended up splitting this up into two batch actions; one to create a new review and another to edit the created review and set it all up .  It appears review edit fails to register the newly created review as it was created in the same connection to the server as the edit is being done.   This is clearly a bug!

Highlighted
New Contributor

Re: Multilines overview in ccollab admin batch

No, we never had any answer back on that subject. We still use the "ccollab --use-legacy-api admin batch" workaround solution...

 

FYI. We are now using ccollab v9.5.9501.

 

Here's an example of our XML batch command:

<batch-commands>

<global-options>
<no-browser/>
<non-interactive/>
<scm>git</scm>
<git-exe>/usr/local/bin/git</git-exe>
</global-options>

<admin_review_create>
<title>My Titile</title>
<custom-field>Overview=line1&#10; line2&#10;&#10;Yet anoher line..</custom-field>
</admin_review_create>

<addgitdiffs>
<upload-comment>commit 496553ae0385a878059fc214accec04d21de441f&#10;Author: Benoit Belley &lt;benoit.belley@autodesk.com&gt;&#10;AuthorDate: Mon Jun 6 09:48:19 2016 -0400&#10;Commit: Benoit Belley &lt;benoit.belley@autodesk.com&gt;&#10;CommitDate: Mon Jun 6 09:54:38 2016 -0400&#10;&#10;line1&#10; line2&#10;&#10;Yet anoher line..</upload-comment>
<review>last</review>
<git-diff-arg>fd3ee9f84130570122abfea8a34fbe339832dda8</git-diff-arg>
<git-diff-arg>HEAD</git-diff-arg>
</addgitdiffs>


<browse>
<review>last</review>
</browse>

</batch-commands>

Highlighted
New Contributor

Re: Multilines overview in ccollab admin batch

Ok. Thanks I'm using v9.3.9300 so there may be a difference here.

But I switched away from TFS specific commands I was using to generic commands, and now I AM able to create a new review and set the custom fields at the same time - here's my excel which is different to yours in the custom fields tags:

 

<?xml version="1.0"?>
<batch-commands>
  <global-options>
    <no-browser />
    <non-interactive />
    <tfs-collection>http://tfsserverURL</tfs-collection>
    <tfs-exe>C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\tf.exe</tfs-exe>
  </global-options>
  <admin_review_create>
    <Template>Template_Standard</Template>
    <Title>Implementation Task</Title>
    <Custom-Field>Project ID=123</Custom-Field>
    <Custom-Field>Project Name=My Project Name</Custom-Field>
    <Custom-Field>Work Item ID=234042</Custom-Field>
    <Custom-Field>Sprint=Somepath\z.Abandoned\test 2</Custom-Field>
  </admin_review_create>
  <addchangelist>
    <review>last</review>
    <changelist>1234</changelist>
  </addchangelist>
  <browse>
    <review>last</review>
  </browse>
</batch-commands>

New Here?
Join us and watch the welcome video:
Building with the Collaborator API

Help Documenation
The Collaborator API is a JSON-RPC API that lets you integrate with Collaborator 9.0 and above. For more information about how the API works, check out the API description here:


Sample Plugins
For an example of an add-in that uses the API, take a look at the Microsoft Word Add-in for Collaborator:


We list all the great plugins our network has already built on this page on the SmartBear website.

Description
SBC2020