Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Get stored property which i saved like this /jira/rest/api/2/project/${projectKey}/properties/MyProp

vdidk December 11, 2018

Hi,
I have  jira server plugin.
I saved my proerty like this

url: `/jira/rest/api/2/project/${projectKey}/properties/MyProp`,
type: 'PUT',
contentType: 'application/json',
dataType: "json",
data: JSON.stringify(entityProperty)


and I get the success response. I try to find this property on server side using Java. I can`t find it in my property set.

ProjectPropertiesManager manager;
PropertySet propset = manager.getPropertySet(project);

 May be  there is another place to look. Any suggestions?

2 answers

1 accepted

0 votes
Answer accepted
vdidk December 11, 2018

In case someone searches for an answer

@JiraImport
ProjectPropertyService projectPropertyService;
JiraAuthenticationContext authenticationContext = ComponentAccessor.getJiraAuthenticationContext();
ApplicationUser user = authenticationContext != null ? authenticationContext.getLoggedInUser() : null;

EntityPropertyService.PropertyResult result = projectPropertyService.getProperty(user, project.getKey(), "MyProp");
EntityProperty property = result.getEntityProperty().getOrNull();
0 votes
Fazila Ashraf
Community Champion
December 11, 2018

Hi @vdidk

Read https://developer.atlassian.com/server/jira/platform/entity-properties/ 

These values can be indexed by Jira and queried via REST API or JQL. 

 

Try the REST call given there to retrieve the property value

vdidk December 11, 2018

thank you for the response, but info in this link doesn`t mention Java objects all.  Unfortunately still don`t have answer for my problem.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events