Need Help on Profields 5.5.x plugin API

Kiranped April 16, 2018

Hi guys,

I have upgraded Profield plugin version to the latest 5.5.x earlier we used 4.9.x.

in one of our custom plugin, we calculating issue field based on it's project field(profields) value. with the new Profields API I am unable to get the field values 

Below is the 4.9.x version code sneppit to get Field value of Type List.

****************4.9.x***********************************

ProfieldsField projectStatusField = getProjectStatusField();

List<SourceValue> sourceValues = new ArrayList<SourceValue>();

sourceValues = (List<SourceValue>)projectStatusField.getValueInProject(issue.getProjectObject());

if (sourceValues.size() > 0){

projectStatusFieldValue = sourceValues.get(0).getValue();

}

****************End***********************************

ProfieldsField service is removed in 5.5.x please let me know how do i get value

***************************5.5.x code Not working ************************

private Field getProjectStatusField(Issue issue){

List<Field> fields = fieldService.get();

 String projectStatusFieldName = config.getPropertyValue("profield.project.status");

for (Field field : fields){

 if (projectStatusFieldName.equals(field.getName())){

 return field;

                                     }

                                                                                          }

return null;

                                                                               }

Field projectStatusField = getProjectStatusField(issue);

// Then i tried using com.deiser.jira.profields.api.value.ValueService; to pass current issue Project object and projectStatusField (Field) to get the value BUT I don't see the corresponding method ---------- Need Help

******************************END****************************************

if not I am planning to user profields REST GET call within JIRA plugin to get the data. Can I do it? kindly suggest 

http://jira-qa.efi.com/rest/profields/api/2.0/values/projects/{projectKey}/fields/{fieldId}

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events