hypotheticalEric Posted May 7, 2017 Report Share Posted May 7, 2017 I'm looking for a way to change the comment attached to a checkin via triggers. Here's the use-case of what I want to do: We use an online image review site called ProofHQ where clients can leave comments on our work as we go. These comments are essentially to-do items like "make this car less red", etc. When they go to check in files to Plastic, rather than have them rewrite or copy / paste all the done items (which we know nobody will do when they are busy, so we get checkin comments like "updates" ), I'd like to allow them to just put in the ProofHQ serial number in the changeset comments, something like "proof:800282" Create a Plastic before-checkin trigger that will look for that serial number string and pull in the comments through the ProofHQ API. add these comments to the changeset comments I tried a really simple example using the before-checkin trigger and changing the PLASTIC_COMMENT environment variable, but it doesn't seem to work. ( I assume Plastic doesn't read this variable back in, just as a publishing mechanism?) Is there a way to either change the comment through the before-checkin trigger or via "cm" commands and after-checkin? thanks! Link to comment Share on other sites More sharing options...
manu Posted May 10, 2017 Report Share Posted May 10, 2017 Hi! unfortunately there's not a pretty way to update a changeset comment. We don't provide a CLI command or a trigger mechanism You can ask for it in our user voice page: https://plasticscm.uservoice.com/forums/15467-general But.... If you are going to be doing this from a secure machine then I think you can use the "cm q" command to do it. You'll need to setup a Plastic SCM client config (clconfigureclient) for the user running the Plastic SCM daemon/service, use the Plastic SCM admin user, only the Plastic SCM admin user (repository server owner) is able to run queries with the "cm q" command. Once everything is ready you'll be able to create a "before-checkin" trigger and change the changeset comment by running something like: (MySQL example) cm q "execquery update object as o inner join changeset as c on o.iobjid=c.iobjid set o.scomment='Test' where c.ichangesetid=1" 'Test' and "1" are fixed values for the example, change it to be variables and use it in your trigger script. Hope it helps! Link to comment Share on other sites More sharing options...
hypotheticalEric Posted May 10, 2017 Author Report Share Posted May 10, 2017 That's a huge help, thanks Manu! I'll put in a request on the uservoice and see if anybody else needs this. In the meantime, I'll play with getting it to work using the query. thanks, - Eric Link to comment Share on other sites More sharing options...
manu Posted May 10, 2017 Report Share Posted May 10, 2017 Great Eric! let me know if you have issues with the "cm q" command. Meanwhile let's check if the uservoice idea gets traction! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.