Forums

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

How to set field description as linked issues

Help_jira August 28, 2022

Hi team

On JIRA service management portal, I have a two request types called "Feedback" and "New change"

On my Feedback form I have a issue picker field(Script runner field) called "Change ticket link" to select "New Change" issues,

When I select any issue in Issue picker field, If any linked issues already with selected New change request, those linked issues I need to set as "Change ticket link" description.

I have written this code on my behavior help me to complete this?

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.config.properties.APKeys
import com.atlassian.jira.datetime.DateTimeFormatter
import com.atlassian.jira.issue.customfields.impl.DateTimeCFType
import com.atlassian.jira.issue.fields.CustomField
import com.onresolve.jira.groovy.user.FieldBehaviours
import org.apache.log4j.Logger
import org.apache.log4j.Level
import groovy.transform.BaseScript

import java.sql.Timestamp
import java.text.SimpleDateFormat

@BaseScript FieldBehaviours fieldBehaviours

// Set the log level
def log = Logger.getLogger(getClass())
log.setLevel(Level.DEBUG)

// The issue picker field name param and also the field this behaviour is connected to in the behaviour
final issuePickerFieldName = "Change ticket link"

def links = ComponentAccessor.getIssueLinkManager().getOutwardLinks(issue.getId())

getFieldByName("TextField").setDescription("${links}")

3 answers

0 votes
Help_jira August 29, 2022

anyone have solution on this.

0 votes
Help_jira August 29, 2022

Any help on this?

0 votes
Joseph Chung Yin
Community Champion
August 28, 2022

@Help_jira -

Welcome to the community.  Need more information from your scripted field setup.  So when customer selects the issue from "Change ticket link", does the field provide the customer with a listing of issuekey? Secondly,  how you setting up the links between your JSM issues with your other issues - Are they done by the customers?

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Infrastructure Applications Team

Viasat Inc.

Help_jira August 28, 2022

Hi @Joseph Chung Yin , Thanks for your reply,

I have project called ABC and having two issuetypes/request types called "Feedback" and "New change".

First customer created "New change" request (ABC-1) and it closed, next customer created feedback for new change and selected ABC-1 from "Change ticket link" (this script runner issue picket which is running through JQl "Project=ABC and issuetype = "New change" and the list of issue will show as "Issue key and Issue summary"), once feedback created(ABC-1) both issue ABC-1 and ABC-2 will link through automation.

My requirement here 

when customer going to create another feedback against ABC-1, ex: when user trying to created another feedback and selected ABC-1 from  "Change ticket link", the field should set helptext like " the selected issue having feedback already "ABC-2 - summary", so that customer know that "new change" already having feedback.

-Musku

Joseph Chung Yin
Community Champion
August 29, 2022

@Help_jira -

I am not aware of any solution where one can generate dynamic help-text on fields even using Script Runner at this time.

Sorry.

Best, Joseph

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events