Package com.atlassian.jira.issue

Examples of com.atlassian.jira.issue.MutableIssue


  /** Returns issue key if possible. Use for debug output. */
  @Nullable
  public static String getDebugIssueKey(long issueId) {
    try {
      IssueManager issueManager = ComponentAccessor.getIssueManager();
      MutableIssue io = issueManager == null ? null : issueManager.getIssueObject(issueId);
      return io == null ? null : io.getKey();
    } catch (Exception ignored) {}
    return null;
  }
View Full Code Here


   * @param issueId the ID of the issue
   * @return the issue, or null if the issue cannot be found or there is an exception getting it
   */
  @Nullable
  protected MutableIssue getIssue(long issueId) {
    MutableIssue issueObject = null;
    try {
      issueObject = myIssueManager.getIssueObject(issueId);
    } catch (Exception e) {
      logger.warn("cannot retrieve issue " + issueId + ": " + e);
    }
View Full Code Here

   * @param key issue key
   * @return the issue, or null if the issue cannot be found or there is an exception getting it
   */
  @Nullable
  protected MutableIssue getIssue(@NotNull String key) {
    MutableIssue issueObject = null;
    try {
      issueObject = myIssueManager.getIssueObject(key);
    } catch (Exception e) {
      logger.warn("cannot retrieve issue " + key + ": " + e);
    }
View Full Code Here

    if (issue != null && issue > 0) {
      b.append(" issue:").append(issue);
      if (!ISSUE_LOOKUP_DISABLED) {
        try {
          IssueManager issueManager = ComponentAccessor.getIssueManager();
          MutableIssue io = issueManager.getIssueObject(issue);
          if (io != null) b.append(" key:").append(io.getKey());
        } catch (Exception e) {
          // ignore
        }
      }
    }
View Full Code Here

   * @param issueId the ID of the issue
   * @return the issue, or null if the issue cannot be found or there is an exception getting it
   */
  @Nullable
  protected MutableIssue getIssue(long issueId) {
    MutableIssue issueObject = null;
    try {
      issueObject = myIssueManager.getIssueObject(issueId);
    } catch (Exception e) {
      logger.warn("cannot retrieve issue " + issueId + ": " + e);
    }
View Full Code Here

   * @param key issue key
   * @return the issue, or null if the issue cannot be found or there is an exception getting it
   */
  @Nullable
  protected MutableIssue getIssue(@NotNull String key) {
    MutableIssue issueObject = null;
    try {
      issueObject = myIssueManager.getIssueObject(key);
    } catch (Exception e) {
      logger.warn("cannot retrieve issue " + key + ": " + e);
    }
View Full Code Here

   */
  @NotNull
  public static String issueDebug(@Nullable Long issue) {
    if (issue == null) return "null";
    StringBuilder r = new StringBuilder("(");
    MutableIssue issueObject = null;
    try {
      issueObject = ComponentAccessor.getIssueManager().getIssueObject(issue);
    } catch (Exception e) {
// ignore e
    }
    if (issueObject != null) {
      r.append(issueObject.getKey()).append(' ');
    }
    r.append(issue);
    r.append(')');
    return r.toString();
  }
View Full Code Here

   * @see com.opensymphony.workflow.FunctionProvider#execute(java.util.Map, java.util.Map, com.opensymphony.module.propertyset.PropertySet)
   */
  public void execute(Map transientVars, Map args, PropertySet ps)
      throws WorkflowException {
   
    MutableIssue mIssue = (MutableIssue) transientVars.get("issue");
   
    ComponentManager componentManager = ComponentManager.getInstance();
    final CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();
    final CustomField dateResolved = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.DATE_RESOLVED);       
    final CustomField dateResponded = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.DATE_RESPONDED);       
    final CustomField slaLastCalculated = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.SLA_LAST_CALCULATED);       
    final CustomField responseSlaState = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.RESPONSE_SLA_STATE);       
    final CustomField fixSlaState = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.FIX_KPI_STATE);       
    final CustomField timeElapsed = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.TIME_ELAPSED);       
    final CustomField onHold = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.ON_HOLD);       

    final Project project = mIssue.getProjectObject();
    final GenericValue securityLevel = mIssue.getSecurityLevel();
   
    final ClientSLAConfig clientSLAConfiguration = SLAServiceJob.getClientSLAConfiguration(securityLevel.getString("name"), project.getName());
    if (clientSLAConfiguration != null)
    {
      User user;
      try {
        user = UserUtils.getUser(SLAServiceJob.getSLAServiceUserName());
      } catch (EntityNotFoundException e) {
        e.printStackTrace();
        throw new WorkflowException(e.getMessage());
      }
      SLAServiceJob.updateIssueSLAFields(clientSLAConfiguration, dateResolved, dateResponded,
          slaLastCalculated, responseSlaState,
          fixSlaState, timeElapsed, onHold, mIssue, user);
    }
    final Object onHoldVal = mIssue.getCustomFieldValue(onHold);
    onHold.updateValue(null, mIssue, new ModifiedValue(onHoldVal, new Timestamp(System.currentTimeMillis())), new DefaultIssueChangeHolder());

  }
View Full Code Here

   * @see com.opensymphony.workflow.FunctionProvider#execute(java.util.Map, java.util.Map, com.opensymphony.module.propertyset.PropertySet)
   */
  public void execute(Map transientVars, Map args, PropertySet ps)
      throws WorkflowException {
   
    MutableIssue mIssue = (MutableIssue) transientVars.get("issue");
   
    ComponentManager componentManager = ComponentManager.getInstance();
    final CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();
    final CustomField dateResolved = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.DATE_RESOLVED);       
    final CustomField dateResponded = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.DATE_RESPONDED);       
    final CustomField slaLastCalculated = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.SLA_LAST_CALCULATED);       
    final CustomField responseSlaState = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.RESPONSE_SLA_STATE);       
    final CustomField fixSlaState = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.FIX_KPI_STATE);       
    final CustomField timeElapsed = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.TIME_ELAPSED);       
    final CustomField onHold = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.ON_HOLD);       

   
    final Project project = mIssue.getProjectObject();
    final GenericValue securityLevel = mIssue.getSecurityLevel();
   
    final ClientSLAConfig clientSLAConfiguration = SLAServiceJob.getClientSLAConfiguration(securityLevel.getString("name"), project.getName());
    if (clientSLAConfiguration != null)
    {
      User user;
      try {
        user = UserUtils.getUser(SLAServiceJob.getSLAServiceUserName());
      } catch (EntityNotFoundException e) {
        e.printStackTrace();
        throw new WorkflowException(e.getMessage());
      }
 
      SLAServiceJob.updateIssueSLAFields(clientSLAConfiguration, dateResolved, dateResponded,
          slaLastCalculated, responseSlaState,
          fixSlaState, timeElapsed, onHold, mIssue, user);
    }   
    final Object dateResolvedVal = mIssue.getCustomFieldValue(dateResolved);
    dateResolved.updateValue(null, mIssue, new ModifiedValue(dateResolvedVal, new Timestamp(System.currentTimeMillis())), new DefaultIssueChangeHolder());

  }
View Full Code Here

  /* (non-Javadoc)
   * @see com.opensymphony.workflow.FunctionProvider#execute(java.util.Map, java.util.Map, com.opensymphony.module.propertyset.PropertySet)
   */
  public void execute(Map transientVars, Map args, PropertySet ps)
      throws WorkflowException {
    MutableIssue mIssue = (MutableIssue) transientVars.get("issue");
   
    ComponentManager componentManager = ComponentManager.getInstance();
    final CustomFieldManager customFieldManager = componentManager.getCustomFieldManager();
    final CustomField slaLastCalculated = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.SLA_LAST_CALCULATED);       
    final CustomField onHold = customFieldManager.getCustomFieldObjectByName(SLAServiceJob.ON_HOLD);       

    final Timestamp slaLastCalculatedVal = (Timestamp)mIssue.getCustomFieldValue(slaLastCalculated);

    // remove on hold timestamp
    onHold.removeValueFromIssueObject(mIssue);
   
    // updated last calculation time to now
View Full Code Here

TOP

Related Classes of com.atlassian.jira.issue.MutableIssue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.