How to display custom fields at different stages for different projects

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
mantisNoob2
Posts: 8
Joined: 30 May 2017, 16:36

How to display custom fields at different stages for different projects

Post by mantisNoob2 »

Hi all,

We have several projects that need to share a group of custom fields so that we can move tickets between projects without loss of information (specifically, without hiding the information). However, we do not want to display all shared fields when Reporting Issues, for example. Fields that aren't relevant to a given project should only be displayed when updating the issue.

Is it possible for two projects to share a custom field where one project only displays the field during reporting (for example), while the other project only displays the field when updating?

We are open to brute-forcing the issue in php by displaying all custom fields every time an existing issue is opened (On Update) if that is the best approach.

Thank you,
Jaret
mantisNoob2
Posts: 8
Joined: 30 May 2017, 16:36

Re: How to display custom fields at different stages for different projects

Post by mantisNoob2 »

I believe I figured it out, but please let me know if there is a more preferred method.

I simply modified bug_view_inc.php to set $t_related_custom_field_ids to get linked ids for all projects on line 699:

Code: Select all

$t_related_custom_field_ids = custom_field_get_linked_ids( $t_bug->ALL_PROJECTS );  // Old parameter:( $t_bug->project_id );
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: How to display custom fields at different stages for different projects

Post by cas »

I do not think there is a standard way of achieving this out of the box.
So if it works for you, it is perfect.
Do remember that such changes need to be re-applied with each update :mrgreen:
mantisNoob2
Posts: 8
Joined: 30 May 2017, 16:36

Re: How to display custom fields at different stages for different projects

Post by mantisNoob2 »

Ok great, thank you for the reply!
Post Reply