How to get jira project properties from jira plugin?

Mamikon Papikyan November 6, 2020

Hi Atlassian,

I am able to get/set Jira project property with API.
Currently I need to get it from my jira plugin using getEntityProperty.
It worked with Jira 7.x perfectly, but for Jira 8.x I get the following error:

java.lang.NoSuchMethodError: com.atlassian.jira.entity.property.EntityPropertyService$PropertyServiceResult.getEntityProperty()Lcom/atlassian/fugue/Option;
...........

Below is my java code to get the property:

ApplicationUser user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
ProjectPropertyService projectPropertyService =
ComponentAccessor.getComponent(ProjectPropertyService.class);
EntityPropertyService.PropertyResult propertyValues =
projectPropertyService.getProperty(user, proj_id, SEARCH_KEY);
Option<EntityProperty> jsonValues = propertyValues.getEntityProperty();
EntityProperty value1 = jsonValues.getOrNull();
JSONObject result = new JSONObject(value1.getValue().toString());
str = result.get("string").toString();

Thanks,

@Mamikon Papikyan 

1 answer

0 votes
Dario B
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 19, 2020

Hello @Mamikon Papikyan ,

I believe I have just answered this question in another thread you created:

 

However, in short:

 

 

Cheers,
Dario

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events