Ejemplo n.º 1
0
 /**
  * Creates an issue tracker component.
  */
 private void setDefaultAssignee(String channel, String sender, String subcomponent, String owner) {
     if (!isSenderAuthorized(channel,sender)) {
         insufficientPermissionError(channel);
         return;
     }
     
     sendMessage(channel,String.format("Changing default assignee of subcomponent %s to %s",subcomponent,owner));
     
     try {
         JiraScraper js = new JiraScraper();
         js.setDefaultAssignee("JENKINS", subcomponent, AssigneeType.COMPONENT_LEAD, owner);
         sendMessage(channel,"Default assignee set to " + owner);
     } catch (Exception e) {
         sendMessage(channel,"Failed to set default assignee: "+e.getMessage());
         e.printStackTrace();
     }
 }
Ejemplo n.º 2
0
    /**
     * Creates an issue tracker component.
     */
    private void createComponent(String channel, String sender, String subcomponent, String owner) {
        if (!isSenderAuthorized(channel,sender)) {
            insufficientPermissionError(channel);
            return;
        }

        sendMessage(channel,String.format("Adding a new subcomponent %s to the bug tracker, owned by %s",subcomponent,owner));

        try {
            JiraScraper js = new JiraScraper();
            js.createComponent("JENKINS", subcomponent, owner, AssigneeType.COMPONENT_LEAD);
            sendMessage(channel,"New component created");
        } catch (Exception e) {
            sendMessage(channel,"Failed to create a new component: "+e.getMessage());
            e.printStackTrace();
        }
    }