Popping up a dialog or message box to give a warning but not blocking a workflow transition

Randy July 26, 2017

There is a request to have a dialog box pop up warning a user to ask if they have done certain things. However they just want it to be a warning and not block a transition from one workflow state to another. I see validators or postflow functions that come with some of the plugins we have but they require a field to be populated or else they will block the transition. Is there something out there that I am potentially missing? We are on Jira 7.0.11 for server.

 

Thanks in advance.

4 answers

1 vote
Ricardo Brito July 9, 2020

Just copy the HTML code on custom field description and set aui message type. See more on:

https://docs.atlassian.com/aui/7.9.3/docs/messages.html

 

<div class="aui-message aui-message-error">
<p class="title">
<strong>Error!</strong>
</p>
<p>And this is just content in a Default message.</p>
</div>
Malene Vikkelsø January 24, 2022

Hi Ricardo,

I am looking into you solution, but could you provide a few more steps.

I cannot seem to get it to work, I have a custom field of Checkboxes, and for the custom field description I have copied your HTML, however nothing shows up when I hover over the custom field on an issue, in view-mode. The field is present on the view screen.

Cheers,

Malene

1 vote
Rachel Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2017

Hi Randy,

You can do exactly this with an add-on (for both JIRA Cloud and JIRA Server) called the "JIRA Toolkit Plugin".   It provides two very helpful field types called "Message Custom Field (for view)" and "Message Custom
Field (for edit)."

These fields allow you to display text or HTML on your issue or workflow transition screens. They particularity help to provide additional instruction, display a warning, or link to additional information.

To place a message on a view screen, use the "Message Custom Field (for view)" field type. To place a message on a create, edit, or transition screen, (which sounds like what you want) use the "Message Custom Field (for edit)" field type.

I add some nicely formatted HTML to make my message really stand out. I love this feature!

Hope this helps,

Rachel Wright

vbondoux November 15, 2017

Hi @Rachel Wright

Unfortunately, when we add this sort of custom fields on the screen of transition it doesn't appear on the popin screen. Maybe because it's reserved for Edit or View screens..

 

Have you another solution

 

Many thanks

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 15, 2017

They're not "reserved", but the language in Jira-speak is a bit confusing here.

Jira's issue type screen scheme system talks about "View", "Create" and "Edit" screens for an issue type.  The fourth type of screen is a "Transition" screen.

However, the Jira Toolkit's message box field also uses "edit" and "view" to describe something underlying the Jira screens and they do NOT mean the same as the issue type screen scheme.

They actually mean "how the screen handles in a browser".  A "view" screen to the toolkit means "Putting things on the screen in a flat text/image format".  And an "edit" screen means "put fields in front of the user so they can change the data".

So... The view type message field only works on issue view screens.  The edit type message field only works on screens for data entry, which in Jira-speak is all the Create, Edit and Transition screens.

You say "when we add this sort of custom fields on the screen of transition it doesn't appear on the popin screen".  This will be down to a couple of possible mistakes we see all the time:

  • You've not put the text for the field in the default content box (a lot of people, especially me, put their text in the description - it's an easy mistake to make)
  • As described above - a transition screen is an "edit" screen, but you've used a "view" type message field.  Try putting an "edit" message field instead.
Like Pascal MALFOY likes this
vbondoux November 15, 2017

Hi @Nic Brough -Adaptavist-

Thank you for your answer
I verified on my JIRA and you can see that :

- I used Edit Field Message

- I inserted the text in the default content box

CustomField.png

I added it in a transition screen

Screen.pngAnd the result, nothing appear in the popin information transition message...

Popin.png

(I reindexed JIRA but it doesn't change anything)

Many thanks for your help

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 15, 2017

Rachael beat me to it, and explained how to get there better, but I did say it before -

"You've not put the text for the field in the default content box (a lot of people, especially me, put their text in the description - it's an easy mistake to make)"

Randy February 5, 2018

Hi Nic or Rachel, 

 

Going back to this original thread I started awhile back ago on Jira Toolkit Plugin. I recently saw this weird error when doing a bulk edit. All the Message Custom Field for Edit's are all lumped together on the Bulk Edit page. Since I have different messages for different screens, I don't believe this to be a screen issue. I am guessing this is not normal but wanted to confirm if this was just me or everyone else as well?

 

Thanks in advance for any enlightening advice you might have.

 

-Randy

Randy February 5, 2018

Forgot to mention that this was happening in Step 3 of Bulk Operation when I click "Edit Issues". This was on Jira 7.0.11.

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2018

It is normal.  Bulk edit lists all the available fields, but doesn't look at how they work.  The message field for edit look like editable fields to the bulk edit, so it puts them in front of you.

Randy February 6, 2018

Thanks Nic for that quick reply.

 

Is there any way not to show these on a bulk edit as it seems really confusing?

 

Thanks,

Randy

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 6, 2018

I'm afraid they can't be removed.  Bulk edit shows every edit field.

0 votes
Radek Janata July 9, 2019

I've resolved this my own way. With Jira Toolkit custom fields I would have to have several custom fields for various transitions.

Since I guide users using transition descriptions, I've created a universal custom fields that always displays current transition description (if it exists) on the transition screen.

Steps

  1. create universal custom field - e.g. Transition Description Warning in my case (any type, I use simple text field)
  2. edit the custom field and add the code below to its description
  3. add the field to any transition screen where you want to display transition description
  4. add your own description in to your workflow transitions

Code (custom field description)

Don't forget to change this custom field ID in the code (#customfield_xxxxx)!

<script>
var transId = $(".jira-dialog.jira-dialog-open")[0].id.match("[0-9]+")[0] // getting transition ID
var transDesc = $("#action_id_"+transId)[0].title // getting transition title (description)

if (transDesc) {
transDesc = transDesc.match(".* - (.*)")[1] // getting second part from transition description
$("#customfield_14218").parent().parent().prepend('<div id="customWorkflowMessage" class="aui-message aui-message-warning"><p>' + transDesc + '</p></div>')
}

$("#customfield_14218").parent().css('display', 'none') // hiding this customfield
</script>

This works well on Jira 7.3, newer versions might require some customizations.

Radek Janata July 16, 2019

Later I've found out that this does not work when transitioning issues on board (workflow description/title is not available). And I haven't found any other way to display the warning when moving issues on boards - so no warning is displayed in this case :-(

Fixed JS code:

<script>
var transId = $(".jira-dialog.jira-dialog-open")[0].id.match("[0-9]+")[0] // getting transition ID
var transObj = $("#action_id_"+transId)

if (transObj[0]) {
var transDesc = transObj[0].title // if the description was found, get the transition title (description)
}

if (transDesc) {
transDesc = transDesc.match(".* - (.*)")[1] // getting second part from transition description)
$("#customfield_14218").parent().parent().prepend('<div id="customWorkflowMessage" class="aui-message aui-message-warning"><p>' + transDesc + '</p></div>')
}

$("#customfield_14218").parent().css('display', 'none') // hiding this customfield
</script> 

 

0 votes
Rachel Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 15, 2017

Hi again Randy,

Your screenshot shows that you've added a value to the field's "Description" but that's different than adding information to the field's "Default" value. 

From the "Custom fields" Admin screen, choose the "Configure" option (not the "Edit" option.)  That's where you want to add your message and/or message formatting.

See screenshot.

default-value.png

And I love @Nic Brough (Adaptavist)'s explanation of "Edit" vs "View"!  :)  :)

vbondoux November 16, 2017

Hi Rachel ! Many thanks, I understood my mistake ! It works ! Have a nice day !

 

@Nic Brough -Adaptavist-It was not so clear but many thanks. Default value is the good explanation.

 

BR

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events