For basic information on plugins, please refer: Infocapture plugins
In this section we would see how to change the “Assigned” field value to the “Reported by” field value, if the value of the field “Reported on behalf of” is changed to a user other than the user reporting the issue
You can find the xml file of the form here:
Lets suppose we have this test project with ID = 34
To achive this we would require plugin_34_add_issue.php
<?php function hd_plugin_34_add_issue($params) { $issue_info = $params["issue"]; $issue_fields = $params["issue"]["fields_values"]; $reported_on = $issue_fields["reported_on"]; $reporter = $issue_info["reporter"]; $result["issue"] = array(); if($reported_on != 1) $result["issue"]["assigned"] = $reporter; return $result; } ?>
Place the above file in the folder: /httpdocs/intranet/helpdesk/plugins/
I have logged in as “Claromentis Administrator” and I am reporting on behalf of “User 1 TEST”.
After reporting the issue, the “Assigned” field value is set to the “Reported by” value (Claromentis Administrator over here)
Discussion