How to update a Message Custom Field on transition

Espen Sandall December 13, 2018

Hi, we're using a Message Custom Field (for View) to give the user some html coded information about the process.

Ideally this field should change it's value depending on the status in the workflow, so that the information reflects the current status, to guide the user through each step.

Automation for Jira does not seem to support such a field type, and I haven't succeeded with ScriptRunner either.

Would anybody know if such an operation is at all possible?
If not - any idea how to solve this differently?

Regards,
Espen

1 answer

0 votes
Nic Brough -Adaptavist-
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.
December 13, 2018

There's no way to do it with the Message fields.  A message field reads its default value and puts that on-screen when the field is present.

There is only one default value for any field.  So you can't change values in there.  Your html would have to be dynamic, including scripting to fetch (at least) the status and use it to work out what do display.  You can't "set" a value for a field that is just parroting a single string it has been fed!

The best I can do without code is to suggest you have a different field that appears on transition screens.

With code, I'd use Scriptrunner to create a "scripted field" that does something like:

case (status)

open:  return text 1

in progress:  return text 2

done: return text 3

Espen Sandall December 14, 2018

Thank you Nic!

A shame I can't use the Message Field.

Then I'll probably choose a free text field with wiki-markup instead, change the value on transition using Automation for Jira, and make it read-only using Behaviours.

(Either that, or with ScriptRunner code as post-functions.)

Cheers,
Espen

Suggest an answer

Log in or Sign up to answer