Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,409
Community Members
 
Community Events
184
Community Groups

Can a bundled field value be accessed in a Behaviour script before the issue is created?

Hello,

I have a custom field that I would like to update depending on what value is entered for an Extension for Jira Service Desk's bundled custom field. When I access the value of a bundled field from a groovy script in a workflow post function I use something like:

Integer row = 0
for(row = 0; row < 10; row++){

def finalTravelExpenses = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Final expense 2")

String finalExpenseValue = issue.getCustomFieldValue(finalTravelExpenses)

if(finalTravelExpenses != null){

Object jsonValue = new JsonSlurper().parseText(finalExpenseValue)
List fields = getFieldsForRow(row, (Map) jsonValue)
Map expensePaidToOther = getFieldByName("Amount Paid to Other", fields)
def expensePaidToOtherValue = getFieldValue(expensePaidToOther)
}
}

def String getOptionValue(Map field) {
List<Map> options = (List<Map>) field.options
Map option = options.find { it.id == field.value }
return option ? option.name : null
}

def Map getFieldByName(fieldName, List<Map> fields) {
return fields.find { it.name == fieldName }
}

def List getFieldsForRow(row, Map json) {
List fields = null
int i = 0
json.each { k, v ->
if (i == row) {
fields = ((Map) v).get("fields")
}
i++
}
return fields
}


What I was wondering is, is if I want to get this field's value in the customer portal using groovy script and a tool like ScriptRunner's Behaviours, is it possible to obtain, or is it only available to access after the issue is created.

Thank you

2 answers

0 votes
Steven Mustari
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.
Apr 30, 2021

I've entered a ticket with Deviniti support on this topic, I believe it is something they are working towards.

Z B
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.
Jun 04, 2021

Hi, do you have any news on this?

Like Steven Mustari likes this
Steven Mustari
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.
Jun 08, 2021 • edited

Here is the response I got from Deviniti support.

"Please be informed that due to the numerous other urgent tasks we have planned for the current months, the ETA for the new feature you requested (to support setHidden and setRequired methods),
I can provide you at the moment is the end of Q3 2021.
I wish I could provide you with a better answer, nevertheless, I hope you will understand our position.
"


So hopefully soon or it at least looks like they are recognizing the need for this.

Like Z B likes this

I meet same problem, seems no answer or solution yet

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events