Behaviour: Making nfeed fields required



I have checkbox field with 3 options and a nfeed field which is populated from a database. My use case: When option 1 is checked i want to show the nfeed field via formField.setHidden(false) and make it required via formField.setRequired(true).


However when i try it, nothing happens but a loading icon at the end of the create form. Only when I remove the line formField.setRequired(true), the field appears. Other customfields work fine with showing and make them required.


Is there a way to make behaviour work with the nfeed field? I'm using Scriptrunner 3.1.4, nfeed 5.4.1 and JIRA 6.4.12

2 answers

1 accepted

Hi Ja,

I have managed to replicate your issue using Scriptrunner 3.1.4, nfeed 5.4.1 and JIRA 6.4.12.

The reason that the behaviour fails to execute is due to the fact that the nFeed field does not support being made required. This is due to the fact that the field is a field which is programmatically populated from an external data source and cannot have its data updated by a user inside of JIRA.

This means that all you can do is hide and un hide the field based on check box options using the behaviours plugin.

I have enclosed an example script below which shows how you can hide and un hide an nFeed field based on a selected option in a checkbox field.

import com.onresolve.jira.groovy.user.FieldBehaviours
import com.onresolve.jira.groovy.user.FormField

// Get a pointer to my check box field
FormField checkBoxField = getFieldByName("DemoChecbox")

// Get a pointer to my nFeed field
FormField nFeedField = getFieldByName("DemoNfeedField")

// Get the checkbox option value as a String
def checkBoxVal = checkBoxField.getValue()

// if Option-1 was selected make the nFeed field visible
if(checkBoxVal == "Option-1"){
// if any other option was selected hide the nFeed Field 

I hope this helps


Hi Kristian,

thanks for the fast answer, now I know I don't have to look for a solution anymore. It's fine for me.



Hi Jan,

Glad I was able to help.

If the answer is useful could you please mark it as accepted incase other are searching for a question similar to this one.



Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,233 views 5 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you