Forum Discussion

lkremer's avatar
lkremer
Occasional Contributor
12 years ago

Is there any way we could add create parameters to the P4 client?

We need to fill a custom field on the review which comes from P4 Description. Is there a way we could configure the P4 SCM client(CodeCollaborator Client) so it would get the parameters from the P4 description and put it into the new review's custom field?



I know that the title has the P4 description, and a create trigger could parse text from it, but the trigger needs to login every time and this is really slow. So the nicest way would be to set parameters to the CodeCollaborator Client.

2 Replies

  • Hi Laszlo,



    An option would be to run a script that first creates a new review and sets the custom fields that you need to change. Here is the documentation for the command to create a review http://support.smartbear.com/viewarticle/25542/



    I tested with this sample shell script:



    #!/bin/sh

    #Params:

    #1: $p

    #2: $u

    #3: $c

    #4: %C

    ccollab admin review create --custom-field "p4field=$4" --title "Review for changelist $4"

    ccollabgui --pause-on-error --scm perforce --p4port $1 --p4user $2 --p4client "emptyArgumentPrefix $3 emptyArgumentSuffix" addchangelist last $4



    Then on P4V, I configured the script as a tool under Tools > Manage Custom Tools... > New > Tool.

    I selected the "Add to applicable context menus" check box on the Add Custom Tool dialog. On the same dialog, I set the Application as the script file and the Arguments as $p $u $c %C



    When I ran the tool, the script first created a new review with the custom field and title I specified. Afterwards the add to review wizard was opened with the review just created as the selected review. After going through the wizard, the review got created with the changelist I selected and the custom field and title I specified on the script.



    Please let us know if this works for you.

     - Manuel