You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
Hello
I woud like to create a listener that will update the behaviour mapping when a project is created (according to its category).
Could you help me ?
I ever tried to this by API but I don't know how they work.
With the following API :
- base-url/rest/scriptrunner/behaviours/1.0/admin/mapping
- base-url/rest/scriptrunner/behaviours/1.0/admin/behaviour
I Tried to post the following Json, but it doesn't work...
"
{"id" : 1,
"name": "Behavior1",
"description": "test",
"mappings": [
{
"type": "PROJECT",
"project": {
"id": 20000,
"name": "Project 1",
"key": "P1"
},
"issuetype": {
"id": "0",
"name": "All issue types",}
},
{
"type": "PROJECT",
"project": {
"id": 20002,
"name": "Project 2",
"key": "P2"
},
"issuetype": {
"id": 12200,
"name": "Work Item"
}
}
]
}
Best regards,
David
With /rest/scriptrunner/behaviours/1.0/admin/mapping
I tried to post this json :
{
"id": 1,
"mappings": [
{
"type": "PROJECT",
"pid": 21401,
"issueTypeId": 12200
}
]
}
But it's still not working.
Please someone know how this API works with post ? (The delete works fine...)
This code works :
def http = new HTTPBuilder("yoururl/rest/scriptrunner/behaviours/1.0/admin/mapping")
def authString = "username:password".getBytes().encodeBase64().toString();
http.request(Method.POST, ContentType.JSON) {
headers."Authorization" = "Basic ${authString}"
headers.contentType = "application/json"
body = "{ \"behaviourId\": \"1\", \"type\": \"PROJECT\", \"projectIds\": [\"${projectID}\"], \"issueTypeIds\": [\"10900\"]}"
response.success = { resp, JSON ->
log.warn("Successful = " + JSON)
}
response.failure = { resp, JSON ->
log.warn("Failed = " + JSON)
}
}
break
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey there Cloud Community members! We’re excited to give you the first glimpse of the new home for business teams on Jira — Jira Work Management. Jira Work Management is the next generation of J...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.