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,551,819
Community Members
 
Community Events
184
Community Groups

How to populate Description field with default value based on component field in JIRA

Edited

Hi All,

We have a requirement to display default value in Description field based on the values selected in Component Field. 

Can anyone provide suggestion.

 

Thanks,

Vasantakumaar

1 comment

Daniel Ebers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 06, 2020

Hi Vasantakumaar,

this is something usually ScriptRunner in a Server environment is used - in case you have this App already it should be easy to get started.

There is even an example which describes nearly exact your use case - just for the Component-requirement you would need to insert some additional code:

https://scriptrunner.adaptavist.com/5.5.8/jira/behaviours-overview.html

Without any additional apps this kind of dependency will not be possible.
Even worse: also putting a default text (without any dependencies) to description is something that is still to come (hopefully!): https://jira.atlassian.com/browse/JRASERVER-4812

Cheers,
Daniel

Hi @Daniel Ebers ,

 

Yeah we have the script runner plugin, I have tried to work on it but not able to validate the components field.

Could you provide help me on this.

 

Thanks,

vasantakumaar

Daniel Ebers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 07, 2020

I have no use case for the components field and never implemented a solution for it.
You would have to do it on your own or probably somebody from Community will contribute to this.

Hi @Daniel Ebers ,

 

I have created a script and tested in our testing environment and it's working.

def formComponent = getFieldById(getFieldChanged())
def desc = getFieldById("description")

def defaultValue1 ="""Test 1""".replaceAll(/ /, '')
def defaultValue2 ="""Test 2""".replaceAll(/ /, '')
def defaultValue3 ="""Test 3""".replaceAll(/ /, '')

List componentFieldValues = formComponent.getValue().collect {it.getName()}

if ("comp1" in componentFieldValues) {
desc.setFormValue(defaultValue1)
}
else if ("comp2" in componentFieldValues) {
desc.setFormValue(defaultValue2)
}
else if ("comp3" in componentFieldValues) {
desc.setFormValue(defaultValue3)
}

 

Thanks for your suggestion.

 

Vasantakumaar 

Daniel Ebers
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 07, 2020

Awesome! I am glad you got it working.

Cheers,
Daniel

Comment

Log in or Sign up to comment