You are right. I should be able to create a script for that, which changes the recipient list based on the claim status.

I've never done any groovy scripts before, but at least I've been able to get the claim status. But after hours of searching, I've not been able to get the users e-mail address from the Jenkins user database. For now, I'll use the returned username as email address (usern...@domain.com), unless you could point me in the right directions? I'm looking for something like hudson.users.getEmailAddress(claim.getClaimedBy()).

For future searchers, this is what I've got so far. It is not production ready - It must be modified to set the email address before it can be used. I'll see if I can attach the finished script when (or if) I'm able to finish it.

def claim = it.getAction("hudson.plugins.claim.ClaimBuildAction")
  if (claim != null) {
    if (claim.isClaimed() == true) {
      %>Claimed by: ${claim.getClaimedBy()} (${claim.getClaimedByName()})\n<%
      if (claim.hasReason() == true ) {
        %>Reason: ${claim.getReason()}\n<%
      }
      if (claim.hasClaimDate() == true ){
        %>Claimed at: ${claim.getClaimDate()}\n<%
      }
    } else {
      %>Not claimed\n<%
    }
  } else {
    %>Claim not supported for this job\n<%
  }
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to