You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I've been beating my head against this wall and lots of searches have been unfruitful. I am trying to port over a simple scripted field from scriptrunner for jira server to one for jira cloud. Here is the old script:
I was able to solve this problem in a slightly different manner with this script:
def issueKey = issue.key
def resp = get("/rest/api/2/issue/${issueKey}")
.header("Content-Type", "application/json")
.asObject(Map)
.body
resp["fields"]["parent"]["key"]
Hi @James Mason
welcome to the community. Scriptrunner Cloud is a little bit different than server.
You need to use the REST API to get the data you need.
Maybe this script will point you into the right direction: https://library.adaptavist.com/entity/sum-custom-field-related-epic-issues?tab=cloud
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Welcome to the Atlassian Community!
Jira Cloud does not support scripted fields the way that server does. You will need to use a standard custom field, and have your script populate it on change of data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So i would need to take the built in field from advanced roadmaps that builds that parent link and dump it into another custom field to be able to retrieve it for viewing?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, exactly that.
On Server/DC, you can use a scripted field with "return <value from wherever>", but Cloud does not support the field type that SR injects on Server/DC, so we have to work with whatever field types that there is a REST API for.
It's not as good as the cleverness of proper scripted fields, because it has become a simple "copy field X to Y", but it works well enough for most (and we're working on proper scripted fields for Cloud with Atlassain)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So how would I read that field? I can see the parent key when I run a get against the issue endpoint but I just can't return it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Same as you would read any other custom field.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.