How to add a mandetory field

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
netanel@komit.co
Posts: 9
Joined: 14 Jan 2018, 10:08

How to add a mandetory field

Post by netanel@komit.co »

Hello again.

1)How do I create a mandatory list field on the create issue report?

2)the list will contain all of the users in the system?

please advise.
Last edited by netanel@komit.co on 30 Jul 2018, 07:21, edited 1 time in total.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How to add a mandetory filed

Post by atrol »

Create a enumeration custom field for it.
https://www.mantisbt.org/docs/master/en ... efinitions

Write a custom function to populate the field
https://www.mantisbt.org/docs/master/en ... ds.dynamic
Please use Search before posting and read the Manual
netanel@komit.co
Posts: 9
Joined: 14 Jan 2018, 10:08

Re: How to add a mandetory filed

Post by netanel@komit.co »

thanks.
But how can I get the list of all the users in the system??
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How to add a mandetory filed

Post by atrol »

You can use function project_get_all_user_rows in core/project_api.php to get a list of users for a given project.
Please use Search before posting and read the Manual
netanel@komit.co
Posts: 9
Joined: 14 Jan 2018, 10:08

Re: How to add a mandetory filed

Post by netanel@komit.co »

I will explain what I want to achieve.

I need to create a mandatory field that contains all of the users in the system.
this field is for users that will be monitoring the issue.
So how can I Create a field similar to "Assign To" and I need it to be under the "Assign To" field ??
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: How to add a mandetory filed

Post by atrol »

I told to create an enumeration custom field and to write a custom function.
Which problems did you get when trying?
netanel@komit.co wrote: 17 Jul 2018, 07:47and I need it to be under the "Assign To" field ??
Not possible out of the box, as custom fields are always placed under the standard fields, see https://www.mantisbt.org/bugs/view.php?id=11385
So you would have to change existing source code, at least if you want to use the mentioned custom field approach.
You would have to write a plugin that uses JavaScript to rearrange the fields to get what you want without changing existing source https://www.mantisbt.org/docs/master/en ... ev.plugins
Please use Search before posting and read the Manual
netanel@komit.co
Posts: 9
Joined: 14 Jan 2018, 10:08

Re: How to add a mandetory filed

Post by netanel@komit.co »

I have created the custom field the function and managed to put the new custom field under the "Assigned To".
my new problem is how to send an e-mail when a user is selected in the new field??
Thanks
Post Reply