Getting warning in logs while creating permissions by using SharePermissionUtils class

Hi Community Members,

We have developed a customized plugin in Jira using Atlassian SDK 6.3.12. This plugin creates projects in Jira instance. Somewhere in the code, we need to create permissions. Below is the code snippet for the same.

public SharedEntity.SharePermissions createSharePermissions(Project project)
SharedEntity.SharePermissions sharePermissions = null;
JSONArray jsonpermissionArray = new JSONArray();
String jsonText= “{“type”:“project”,“param1”:”"+project.getId()+""}";
JSONObject jsonObjectProject = new JSONObject(jsonText);
Map<String,Boolean> map=new HashMap<>();
map.put(“view”, true);
jsonObjectProject.put(“rights”, map);
sharePermissions = SharePermissionUtils.fromJsonArray(jsonpermissionArray);

} catch (JSONException e) {
}catch (Exception e) {
return sharePermissions;

After the above-underlined line, I am getting a warning in logs which says:-

Rights object could not be found in the Share Permission JSON. Right to ‘view’ will be assigned as the default.

In order to resolve this issue when I am manually trying to add the rights object like below


I am again getting an error which states: -

com.atlassian.jira.util.json.JSONException: JSONObject[“rights”] is not a JSONObject.
at com.atlassian.jira.util.json.JSONObject.getJSONObject(
at com.atlassian.jira.sharing.SharePermissionUtils.fromJsonObject(