Package com.atlassian.jira.issue.fields

Examples of com.atlassian.jira.issue.fields.CustomField


      initialiseEventTypeIds(eventTypeManager);

      // create service context to execute search with
      JiraServiceContextImpl jiraServiceContextImpl = new JiraServiceContextImpl(user);

      final CustomField securityLevel = customFieldManager.getCustomFieldObjectByName(SECURITY_LEVEL);
      final CustomField dateResolved = customFieldManager.getCustomFieldObjectByName(DATE_RESOLVED);       
      final CustomField dateResponded = customFieldManager.getCustomFieldObjectByName(DATE_RESPONDED);       
      final CustomField slaLastCalculated = customFieldManager.getCustomFieldObjectByName(SLA_LAST_CALCULATED);       
      final CustomField responseSlaState = customFieldManager.getCustomFieldObjectByName(RESPONSE_SLA_STATE);       
      final CustomField fixSlaState = customFieldManager.getCustomFieldObjectByName(FIX_KPI_STATE);       
      final CustomField timeElapsed = customFieldManager.getCustomFieldObjectByName(TIME_ELAPSED);       
      final CustomField onHold = customFieldManager.getCustomFieldObjectByName(ON_HOLD);       
//      final CustomField incidentPriority = customFieldManager.getCustomFieldObjectByName(INCIDENT_PRIORITY);


      final Iterator iterator = clientSLAConfigurations.iterator();
      while (iterator.hasNext()) {
View Full Code Here


   
    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

   
    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();
   
View Full Code Here

      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
    slaLastCalculated.updateValue(null, mIssue, new ModifiedValue(slaLastCalculatedVal, new Timestamp(System.currentTimeMillis())), new DefaultIssueChangeHolder());
  }
View Full Code Here

   
    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();
   
View Full Code Here

        String cfId = (String) args.get("cfId");
        String invalid_statuses = (String) args.get("invalid_statuses");

        if (cfId != null && cfId.length() > 0)
        {
            CustomField cfObj = ComponentManager.getInstance().getCustomFieldManager().getCustomFieldObject(cfId);
            if (cfObj != null)
            {
                Object cfValObj = issue.getCustomFieldValue(cfObj);
                if (cfValObj != null)
                {
View Full Code Here

    {
        String cfId = getParam(descriptor, "cfId");
        String realCf = "";
        if (cfId != null && cfId.length() > 0)
        {
            CustomField cfObj = ComponentManager.getInstance().getCustomFieldManager().getCustomFieldObject(cfId);
            if (cfObj != null)
            {
                realCf = cfObj.getName();
            }
        }

        StringBuilder realStatuses = new StringBuilder();
        Set<String> statuses = getSetParams(descriptor, "invalid_statuses");
View Full Code Here

    }

    @Override
    protected String doExecute() throws Exception
    {
        CustomField field = ComponentManager.getInstance().getCustomFieldManager().getCustomFieldObject(cfid);

        String jqlData = null;
        if (field.isAllProjects())
        {
            jqlData = qfMgr.getQueryFieldData(field.getIdAsLong(), Long.valueOf(prId));
        }
        else
        {
            jqlData = qfMgr.getQueryFieldData(field.getIdAsLong(), Long.valueOf(prId));
        }

        User user = ComponentManager.getInstance().getJiraAuthenticationContext().getLoggedInUser();
        SearchService.ParseResult parseResult = searchService.parseQuery(user, jqlData);
        if (parseResult.isValid())
View Full Code Here

    public void validateFromParams(CustomFieldParams cfParams,
        ErrorCollection errorCollection, FieldConfig fieldConfig)
    {
        @SuppressWarnings("unchecked")
        final Collection<String> params = cfParams.getAllValues();
        CustomField cf = fieldConfig.getCustomField();
        JiraAuthenticationContext authCtx = ComponentManager.getInstance()
            .getJiraAuthenticationContext();
        I18nHelper i18n = authCtx.getI18nHelper();
        UserProjectHistoryManager userProjectHistoryManager = ComponentManager
            .getComponentInstanceOfType(UserProjectHistoryManager.class);
        Project currentProject = userProjectHistoryManager.getCurrentProject(
            Permissions.BROWSE, authCtx.getLoggedInUser());

        boolean isAutocompleteView;
        if (cf.isAllProjects())
        {
            isAutocompleteView = qfMgr.isAutocompleteView(cf.getIdAsLong(),
                Consts.PROJECT_ID_FOR_GLOBAL_CF);        }
        else
        {
            isAutocompleteView = qfMgr.isAutocompleteView(cf.getIdAsLong(),
                currentProject.getId());
        }
       
        if (isAutocompleteView)
        {
            if ((params == null) || params.isEmpty())
            {
                boolean addNull;
                if (cf.isAllProjects())
                {
                    addNull = qfMgr.getAddNull(cf.getIdAsLong(),
                        Consts.PROJECT_ID_FOR_GLOBAL_CF);
                }
                else
                {
                    addNull = qfMgr.getAddNull(cf.getIdAsLong(),
                        currentProject.getId());
                }

                if (!addNull)
                {
View Full Code Here

        AutocompleteUniversalData data;
        List<AutocompleteUniversalData> values = null;

        if (Utils.isValidStr(cfId))
        {
            CustomField cf = ComponentManager.getInstance()
                .getCustomFieldManager().getCustomFieldObject(cfId);
            if (cf == null)
            {
                log.error("QueryAutocompleteService::getCfVals - Custom field is null. Incorrect data in plugin settings");
                return Response
                    .ok(i18n.getText("queryfields.service.error.cfid.invalid"))
                    .status(400).build();
            }

            String jqlData;
            if (cf.isAllProjects())
            {
                jqlData = qfMgr.getQueryFieldData(cf.getIdAsLong(),
                    Consts.PROJECT_ID_FOR_GLOBAL_CF);
            }
            else
            {
                UserProjectHistoryManager userProjectHistoryManager = ComponentManager
                    .getComponentInstanceOfType(UserProjectHistoryManager.class);
                Project currentProject = userProjectHistoryManager
                    .getCurrentProject(Permissions.BROWSE,
                        authCtx.getLoggedInUser());
                if (currentProject == null)
                {
                    log.error("QueryAutocompleteService::getCfVals - Current project is null");
                    return Response
                        .ok(i18n.getText("queryfields.service.error.curproject"))
                        .status(400).build();
                }
                jqlData = qfMgr.getQueryFieldData(cf.getIdAsLong(),
                    currentProject.getId());
            }

            List<Issue> issues = Utils.executeJQLQuery(jqlData);
            values = new ArrayList<AutocompleteUniversalData>(issues.size());
View Full Code Here

TOP

Related Classes of com.atlassian.jira.issue.fields.CustomField

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.