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,558,455
Community Members
 
Community Events
184
Community Groups

based on elements connect field value labels value should be assigned

Hi ,

There is one requirement from end user based on elements connect field value(EngSolutions_Mumbai_HLS), system labels field value should set. If labels have existing values new value should append to existing value. I am using below script, but it is not working as expected can someone help me on this. I am sharing the script also.

 

import com.onresolve.jira.groovy.user.FormField;
import com.atlassian.jira.issue.IssueFieldConstants
import groovy.json.JsonSlurper
 
FormField descriptionField = getFieldById(IssueFieldConstants.LABELS)
FormField elementsConnectField = getFieldById("customfield_14082")
String connectFieldValue= elementsConnectField.getFormValue()
def currentLabels = descriptionField.getFormValue()
def newLabels = ['noautoclose']
if(connectFieldValue){
    def jsonSlurper = new JsonSlurper()
    def json = jsonSlurper.parseText(connectFieldValue)
    def connectFieldKeys = json["EngSolutions_Mumbai_HLS"]
 
    if (connectFieldKeys[0].equals("EngSolutions_Mumbai_HLS")) {
        descriptionField.setFormValue(newLabels);
    }
}
Screenshot 2023-05-04 150931.png

2 answers

1 accepted

0 votes
Answer accepted
Simon Laffont
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.
May 04, 2023 • edited

Hello @Parsa Mounika

I am part of the Elements Connect support team.

What you are asking should be possible. But to answer you, I need to know more about your Connect field configuration.

I invite you to raise a request on our support platform so that we can look at this together in private.

Thank you.

Kind regards,
Simon.

0 votes
Ken McClean
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.
May 05, 2023

I was curious if you needed some kind of "commit" type statement to make the changes stick.  For example, if you're updating an Issue in Jira you need to use the IssueManager's UpdateIssueRequest method to actually commit the changes to the database.

Looks like that's not necessary in this case for the form object, but it was interesting to dig into. Hopefully this got solved on the vendor support platform.


https://docs.atlassian.com/software/jira/docs/api/7.3.2/com/atlassian/jira/issue/IssueManager.html#updateIssue-com.atlassian.jira.user.ApplicationUser-com.atlassian.jira.issue.MutableIssue-com.atlassian.jira.issue.UpdateIssueRequest-

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events