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,361,178
Community Members
 
Community Events
168
Community Groups

How to set field description as linked issues

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

anyone have solution on this.

Any help on this?

0 votes

@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.

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

@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
Community showcase
Published in Jira Service Management

An unofficial way to monitor a JSM mail handler for errors

...eturns true if any content is returned for the webResponse.body.data.first s...

692 views 2 20
Read article

Atlassian Community Events