Forums

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

Need help with post functions in JIRA cloud

anusha_s26 February 6, 2020

Hi All,

We are migrating from JIRA server to JIRA cloud. We have some custom groovy script which are executed as post functions, those scripts will not run in JIRA cloud.

I have tried using the REST API to change the assignee ID. But I am unable to change it.

Below is the rest API code:

def result = put("/rest/api/2/issue/${issueKey}")
.header('Content-Type', 'application/json')
.body([
fields: [
assignee : [
displayName: 'anusha'
]
]
])
.asString()

Its just setting the assignee ID to Unassigned.

I am also facing trouble with importing some of the classes required to run a groovy script.

Ex:

import com.atlassian.jira.component.ComponentAccessor

Gives an error: unable to resolve.

Needed some guidance on how to proceed here. We have many groovy scripts which have to be migrated.

1 answer

1 accepted

0 votes
Answer accepted
Veera
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 6, 2020

@anusha_s26 

 

In Jira Cloud, it's not possible to assign the tissue using user name. You need to use accountId of the user. Please refer the below REST API doc.

https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-rest-api-3-issue-issueIdOrKey-assignee-put

When you export users into CSV file from your Cloud site, it'll have accountId for all the users.

anusha_s26 February 9, 2020

Thank you. Will try this out.

Can you also suggest me on how to convert some of the complex groovy script from Jira Server to JIRA cloud.

anusha_s26 February 10, 2020

Thank you. Using account ID helped in changing the assignee.

Like Veera likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events