Hello,

When implementing the canRun function in QueueTaskDispatcher, I am able to 
find what caused the item to be queued using item.getCauses(), then casting 
to the appropriate cause.

If the cause is an instance of SCMTriggerCause, I was hoping for a way to 
get to the COMMIT ID that caused this, but instead the short description 
only tells me "Started by an SCM change". The other methods available don't 
seem to help with this. In contrast, the UpstreamCause API provides some 
handy methods to get relevant information.

In the case of a Run, it seems I could grab it from the EnvVars 
"GIT_COMMIT", but I'm working with Queue.Item / Job, so I wonder what 
should be the way to go:

- either get EnvVars from a Job/Queue.Item (not sure how to do so), or;

- instantiate an SCMTriggerItem from my Item, then an SCMTrigger and .. ?

Thank you in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/3f420018-f4ca-4a99-bc6a-f43e99bf893b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to