• 2 replies
  • Latest Post - ‏2014-03-03T16:38:09Z by A_Better_Solution
14 Posts

Pinned topic Modify comment in preop checkin trigger

‏2014-01-23T14:51:01Z | checkin clearcase comment preop trigger

I'm writing a trigger that integrates clearcase with JIRA and as a preop checkin trigger lets the user choose which JIRA issue the checkin is related to and then inserts info into both clearcase and JIRA in order to have traceability between them.

I want to add functionality to my trigger that the checkin comment is modified. I want to insert a string in the beginning of the comment. I've tried using the chevent command cleartool chevent -insert -c "MyComment" "MyFile.c". That command works when running it manually, but when running it in the trigger, the comment doesn't change. Cleartool returns zero (OK).

Any ideas what can be wrong or suggestions how to do things instead?

  • Dave-Robinson
    116 Posts

    Re: Modify comment in preop checkin trigger


    Use chevent in a postop trigger.


    When the perop trigger runs, ClearCase has already retrieved the comment associated with the checkout, and will allow the user to modify this. Whether they modify it or not, the comment they provide will clobber any change you make with chevent in a preop trigger.


    In fact, when your checkin is running, and prompting for a comment, go into another command prompt and describe the still checkedout version. You shall probably see your modified comment ! Which shall revert once you OK the checkin dialog.

  • A_Better_Solution
    5 Posts

    Re: Modify comment in preop checkin trigger


    Hi Staffan,

    You wil have to do that in a POST-op trigger... When in Postop-checkin perform the chevent command to modify the comment.

    You can find lots ot trigger examples here:

    Hope this helps...


     Try ClearTrigger and ClearReplica at

             A Better Solution, Inc.
    Charles Clarke III              ClearCase Consultant
    A Better Solution, Inc.         (770) 252-1500 [phone]
    4303 Cedar Lake Cove            
    Conley, Ga.  30288              (770) 252-1501 [fax]