Forums

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

Getting the value of a custom field that is also a custom type

Taylor Chase August 8, 2018

I have a Stagil Table custom field.  I would like to be able to view the items entered in the table in order to do validation on that information.

It would be good enough for me to get the raw XML or whatever format they use behind the scenes, I just can't figure out how to access the data.

In Scriptrunner, if I try to locate the value of the field similar to how I access other custom field values, it ends up being null.  Any hints as to what I might be doing wrong?

 def issueManager = ComponentAccessor.getIssueManager()
def issue = issueManager.getIssueObject("ASDF-24")
def otherList = customFieldManager.getCustomFieldObjectsByName("NewTableField")
def otherValue = issue.getCustomFieldValue(otherList.first())
if(otherValue) {
log.info("it's not null!")
} else {
log.info("it's null!")
}

 

3 answers

1 accepted

0 votes
Answer accepted
Taylor Chase August 14, 2018

As a follow-up, this is something not currently supported, but their development team is working on.  Eta mid September.

Taylor Chase February 13, 2019

Their newest Administrator's Guide now exposes API calls for directly working with data inside the tables.

https://stagil.atlassian.net/wiki/spaces/STJ/pages/376799265/Administrators+Guide

0 votes
Alexey Matveev
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.
August 8, 2018

Hello,

Try this one:

def issueManager = ComponentAccessor.getIssueManager()
def issue = issueManager.getIssueObject("ASDF-24")
def otherList = customFieldManager.getCustomFieldObjectsByName("NewTableField")
def otherValue = otherList.first().getValue(issue)
if(otherValue) {
log.info("it's not null!")
} else {
log.info("it's null!")
}
Taylor Chase August 8, 2018

Nope, still doesn't work.

I'm going to open a support request with Stagil.

0 votes
Mark Markov
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.
August 8, 2018

Hello @Taylor Chase

I would recommend you to raise request in STAGIL support.

Because your code correct and must work.

Taylor Chase August 8, 2018

Ok. I wasn't sure if a custom field type has any kind of weird requirements I didn't know about :)

I'll go ahead with a service request.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events