Forums

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

comparing reporter to backbonesync id

Pawel Rozek March 10, 2020

Hello,

I am fairly new to Jira Cloud and Scriptrunner in Jira cloud.

I have used scriptrunner on Jira server, but it seems that its much different as I can't seem to figure this out.

I'm trying to perform a post function that updates a summary if an issue is reported by Backbone Sync.

I found the accountID but it doesn't seem to be working as I expected, so in "Condition" section of the post function I added this:

def BBSYNC="10:10alsdfkj234092u3asjdflk2342"
issue.fields.reporter == (user.${BBSYNC})

and under the Additional Code section, I added the following:

String OLDSUMMARY = "${ issue.fields.summary }"
issueInput.fields.summary = "PROD ISSUE - ${OLDSUMMARY}"

 

Besides solving this immediate problem, I'm looking for some guidance as to how to figure out variables and setting them properly for cloud, could someone point me to documentation that explains what is available and what isn't? This documentation wasn't helpful: http://scriptrunner-docs.connect.adaptavist.com/jiracloud/post-functions.html#_edit_post_function

Thanks in advance.

 

1 answer

1 accepted

1 vote
Answer accepted
Kristian Walker _Adaptavist_
Community Champion
March 16, 2020

Hi Pawel,

Thank you for your question.

I can confirm that the best way to see what properties fields on an issue contain that can be set is by navigating to the Script Console and by clicking on the Get Issue Fields link located inside of the Examples section.

Using this script you will be able to return the JSON structure of an issue which has the fields you required set in order to see what properties the fields contain to see how to access or set values on an issue.

As for the reporter field I can confirm that this contains a property called accountId which must be specified when checking if the reporters accountId matches a certain user.

I can confirm I have created the snippet located here which shows how to run the Modify Issue post function when a user matches a specific account ID and to update the summary and this can be used as a reference guide to help you achieve your requirement.

I hope this helps.

Regards,

Kristian

Pawel Rozek March 16, 2020

This is great and extremely helpful. Thank you for such a detailed explanation, this is exactly what I was looking for.

Suggest an answer

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

Atlassian Community Events