Changing Issue Type with Different Field configurations

Drishti Maharaj July 5, 2022

Hi,

I  have tried to get this to work so not sure if I did something wrong or not possible?

I have an issue "Task" that will be logged to the project and follows the default field configuration.
Now working on the "task" the issue type needs to change to an "epic".

However, when changed to "epic" there needs to be a field that is now mandatory to fill out. "Epic" is associated with a different field configuration where that field is set as required. 

The only thing is that I cannot change the "task" to an "epic" when editing the issue - I assume that is because of the two different field configurations?

Is there then a way to make the field mandatory only when "epic" is chosen?

Thanks.

 

1.JPG2.png

1 answer

1 accepted

2 votes
Answer accepted
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.
July 5, 2022

It is the different configuration.

You can use the "move" option to change the issue type, it will take you through a process of checking for data loss and filling in required fields.

Drishti Maharaj July 5, 2022

Thanks @Nic Brough -Adaptavist- - I think they might find the "move" a bit too time consuming when they used to editing issues quickly on the screen itself.

Would this be possible to make the field mandatory with a behavior? I find myself stuck with the issue type and how to define that in the script properly.

This script needs some adjustment and not too sure how as it only makes the field mandatory after you have updated the ticket and I am trying to make it appear mandatory as soon as you change the issue type to "epic" without updating as yet i.e. red asterisk to appear immediately next to field...

 

def custfield = getFieldById("customfield_17914")
 
String issueType = getIssueContext().getIssueType().getName()
if (issueType == "Epic") {
custfield.setHidden(false);
custfield.setRequired(true);
}
Like Bogdan Hurtupan likes this
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.
July 5, 2022

Yes, the "move" option is complex.  It has to be.

By changing an issue to a type with a different configuration, you are effectively making a structural change, and that process may need to ask for new data or warn you that data is going to be deleted.

In the case of converting Story-level issues to Epics, or vice versa, you cannot avoid using move - Epics have a mandatory name field, that can't be put on other issue types, and Epics can not have Epic Links.  The move process will demand a name when going from issue to Epic

To make a field mandatory, I would use field configurations - have one for non-epics, and a second for Epics.  In the Epic one, flag your field as mandatory.  This would force people using "move" to change a story to an Epic to enter something as the type changes, you don't need a Behaviour at all.

Suggest an answer

Log in or Sign up to answer