Forums

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

Custom field condition with Scriptrunner cloud

E01807
April 16, 2019

I'd like to set a condition for a fast-track script based on the value of a custom field. I used to have this working in Scriptrunner (Server) but cannot find an example of how to work it using Scriptrunner (Cloud).

My successful old implementation was:

cfValues['Change Category']?.value == 'Fast Track'

All research done so far indicates I need to hard code the custom field ID to be something like (?!):

issueInput.fields.customfield_10107 == [value: '{{Fast Track}}'] as Map

where 10107 is the custom field ID. Which is not ideal as I'd like to refer to the name instead.

Any ideas?

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
July 29, 2020

@jeff singler is it the complete script? I guess you need to process the results properly, something like

sql.rows('SELECT [VEHICLEID] , [CURRODOM] FROM [FUELMASTER].[dbo].[VehicleCK] where [VEHICLEID] like '%{issue.summary}').each { row -> log.error(row.CURRODOM) }

 I just pust logging function to test what value is logged. Can you try this approach?

jeff singler
July 30, 2020

Thank you for your help, I ended up going a completely different route to achieve this but I will need sometime in the far future to do writes to a DB with Scriptrunner so I will be back at this at some point.

DEPLOYMENT TYPE
SERVER
VERSION
8.11
TAGS
AUG Leaders

Atlassian Community Events