Forums

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

Error Project Role Type in Automation

Andreza Santos March 4, 2021

Hello, I'm setting up a Project creation automation (which is already working), but in the Permission Scheme creation part, I'm taking the error below when I try to use the "Project Role" type:

HTTP response error body: {"errorMessages": ["Can not deserialize instance of java.lang.String out of START_OBJECT token \ n at [Source: org.apache.catalina.connector.CoyoteInputStream@4f8f6be0; line: 5, column: 38] (through reference chain: com.atlassian.jira.rest.api.permission.PermissionSchemeBean [\ "permissions \"] -> com.atlassian.jira.rest.api.permission.PermissionGrantBean [\ "holder \"] -> com.atlassian. jira.rest.api.permission.PermissionHolderBean [\ "type \"]) "]}

This automation is being done by Plugin Automation and this is the only part that is not working, follow the code of the Scheme of permission:

{

    "permissions": [

      {

        "holder": {

        "parameter": "Administrators",

        "type": {

          "projectRole": "10002"

           }

        },

        "permission": "ADMINISTER_PROJECTS"

        }

   ],

   "name": "{{ProjectKey}} - Permission Scheme"

}

 

Can someone help me?

1 answer

1 accepted

1 vote
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
March 4, 2021

Hi @Andreza Santos welcome on th ecommunity :). I think your JSON is not valid. You should use (I guess) following JSON to specify holder:

"holder":{
    "type":"projectRole",
    "parameter":"10002"
}

Let me know, if it won't help :), Thank you. 

Andreza Santos March 4, 2021

Thanks for the answer. Unfortunately it's still not working, but the error has changed, but I can't identify the error in json.

{"errorMessages":["Unexpected character ('â' (code 226)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream@750b4c14; line: 6, column: 18]"]}

 

{
"permissions": [
{
"holder": {
"parameter": "10002",
"type": “projectRole”
},
"permission": "ADMINISTER_PROJECTS"
}
],
"name": "{{ProjectKey}} - Permission Scheme"
}

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
March 4, 2021

Is this characted contained in your ProjectKey?

Andreza Santos March 4, 2021

I checked and that characted is not in ProjectKey, I really don't know what it can be anymore.

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
March 4, 2021

I do not know too, but could you share the whole configuration. We might find something :)

Andreza Santos March 4, 2021

I really don't know what the problem was, but I redid the json and it worked!

Final result:

{
"permissions": [
{
"holder": {
"parameter": "10002",
"type": "projectRole"
},
"permission": "ADMINISTER_PROJECTS"
}
],
"name": "{{ProjectKey}} - Permission Scheme"
}

Thanks for the help!!

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
March 4, 2021

Ok, GREAT JOB :) 

Like Andreza Santos likes this

Suggest an answer

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

Atlassian Community Events