Commit f748d24a authored by Ana Rute Mendes's avatar Ana Rute Mendes 🌈
Browse files

purchasing: avoid multiple items creation

phabricator creates xactions as previews when someone is editing
the tickect through the comments section. We do not want to trigger
the asset creation in Snipe IT in theses cases, otherwise we will
end up with duplicated items in snipe IT.
parent 7b87532f
......@@ -395,8 +395,8 @@ final class ManiphestTransactionEditor
$new_status = $xaction->getNewValue();
// CCU: create Item in the inventory system if it's a Purchase request and
// its status was changed to "resolved" (Closed)
if (!$this->getIsNewObject()) {
// its status was changed to "resolved" (Closed) and it's not a preview
if (!$this->getIsNewObject() && !$this->getIsPreview()) {
try {
$asset_transactions = $snipe_api->createAssetItem($new_status, $object, $xactions);
} catch (Exception $e) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment