Forums

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

Trying to pull the option field from a cascading field and populate a people picker field

Rebecca Allen
December 4, 2020

I'm new to scriptrunner but I'm trying to populate the Assignee with a name entered into a text box in a cascading field.

I found the script below on this site, but it's not working:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.customfields.impl.CascadingSelectCFType
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.issue.fields.CustomField
Issue issue = ComponentAccessor.getIssueManager().getIssueObject("Rig Manager");
CustomField customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Cascade");
Map<String, Option> params = (HashMap<String,Option>) issue.getCustomFieldValue(customField)
if (params != null) {
    Option parent = params.get(CascadingSelectCFType.PARENT_KEY)
    Option child = params.get(CascadingSelectCFType.CHILD_KEY)
}

4 answers

1 accepted

1 vote
Answer accepted
Michael Andreacchio
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2012

A 3rd party plugin has provided this feature of creating and linking a JIRA issue as a post function in a work flow. It is called Exocet.

Details on their product can be found here:https://studio.plugins.atlassian.com/wiki/display/JCALP/Exocet+plugin+for+JIRA

And information on the post function you are concerned with is also documented here.

I hope this helps,

Michael

1 vote
Norman Abramovitz
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 Champions.
May 21, 2012

I believe this plugin will allow you to do what you want. You should be able to create an issue and link it back to the original.

https://pugins.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner

I believe this example plugin script will do what you want.

https://studio.plugins.atlassian.com/wiki/display/GRV/Post+Functions#PostFunctions-Cloneissuewithdependencylink

0 votes
ChelmerL
May 21, 2012

Thanks Norman. Our clients have their own logins. They have the access to push the JIRA's into the next statuses. We can create a separate UAT workflow for when these failures occur. Ideally we'd like JIRA to create a new parent JIRA once they click into Fail UAT. We could ask the client to create a JIRA when this happens, but it would be great if they were directed into a new parent JIRA. Thanks again.

0 votes
Norman Abramovitz
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 Champions.
May 21, 2012

How does your user acceptance testing (UAT) clients interact with Jira? Do they have their own logins or do they email their response to the Jira? Is there an existing UAT jira issue in the system for your clients to interact with? Do you want each client to create their own issue for the same failure?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events