Forums

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

How to find actor details in jira environment?

Nageswara Rao Koppisetti
Contributor
May 21, 2018

Hi All,

I have to update issue status using jira rest services below request payload.

{
    "update": {
        "comment": [
            {
                "add": {
                    "body": "Bug has been fixed."
                }
            }
        ]
    },
    "fields": {
        "assignee": {
            "name": "bob"
        },
        "resolution": {
            "name": "Fixed"
        }
    },
    "transition": {
        "id": "5"
    },
    "historyMetadata": {
        "type": "myplugin:type",
        "description": "text description",
        "descriptionKey": "plugin.changereason.i18.key",
        "activityDescription": "text description",
        "activityDescriptionKey": "plugin.activity.i18.key",
        "actor": {
            "id": "tony",
            "displayName": "Tony",
            "type": "mysystem-user",
            "avatarUrl": "http://mysystem/avatar/tony.jpg",
            "url": "http://mysystem/users/tony"
        },
        "generator": {
            "id": "mysystem-1",
            "type": "mysystem-application"
        },
        "cause": {
            "id": "myevent",
            "type": "mysystem-event"
        },
        "extraData": {
            "keyvalue": "extra data",
            "goes": "here"
        }
    }}

In actor tag i have to provide details for actor.how to find actor details in my jira system.

Could you please help.

I  have one more quick question 

what is generator ,cause,extraData details in above request payload.

 

2 answers

1 vote
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2018

Hello,

The actor is the user under whom you perform the rest call. Description of generator, cause, extraData you can find here:

https://docs.atlassian.com/software/jira/docs/api/7.6.1/com/atlassian/jira/issue/changehistory/metadata/HistoryMetadata.html

Do not fill the historyMetadata part. It must work fine without it.

Nageswara Rao Koppisetti
Contributor
May 21, 2018

Thank you Alexey Matveev,

In request payload trasition id is sending like this 

"transition": {
"id": "3"
},

getting below error:

{
"errorMessages": [
"Transition id '3' is not valid for this issue."
],

I have opened workflow.In my instance i could find any transition id.please find attached screen .where i can get this transition id.

please find attached workflow screen.

TrasitionExample.PNG

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2018

Go to the text tab (not Diagram). You will see numbers near transitions. That would be the transition (action) id.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 21, 2018

You can pass only those fields, which are present on the screen, which you defined for the transaction. I guess, your transaction does not have any screen. That is why omit the fields.

0 votes
Nageswara Rao Koppisetti
Contributor
May 21, 2018

I got  transition id .I am getting below error.

Could you please help me on this.

And provide me any simplified request payload for json.

{
"errorMessages": [],
"errors": {
"resolution": "Field 'resolution' cannot be set. It is not on the appropriate screen, or unknown.",
"assignee": "Field 'assignee' cannot be set. It is not on the appropriate screen, or unknown."
}
}

Tarun Sapra
Community Champion
May 21, 2018

Hello @Nageswara Rao Koppisetti

As @Alexey Matveev shared in his response , you can only submit the fields which are part of the transition screen for a particular transition. In your case the transition id is 3 and for this transition you have to check if the transition screen exists and if it doesn't then you should not enter the field values. From the docs

 If a field is not configured to appear on the transition screen, then it will not be in the transition metadata, and a field validation error will occur if it is submitted.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events