tag icon indicating copy to clipboard operation
tag copied to clipboard

Business rules for tickets do not work when updating tickets

Open verdanatech-marcio opened this issue 1 year ago • 9 comments

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • [x] I have searched the existing issues

GLPI Version

10.0.17

Plugin version

2.12.1

Bug description

I created a rule to assign a tag if a category is assigned to the ticket. When the ticket is created the rule works normally. If the ticket is updated and the category is added the rule does not work.

Relevant log output


Page URL

https://dev-marcio.verdanadesk.com/front/ticket.form.php

Steps To reproduce

1- Adding a new ticket with the category assigned to the rule is executed and works correctly. 2- Adding the category equivalent to that present in the rule to an open ticket. In this case of update, the rule is not executed.

Your GLPI setup information

Instruções de instalação e configuração
GLPI 10.0.17 ( => /home/marcio-local/public_html/verdanadesk)
Installation mode: GIT
Current language:pt_BR

Server
 
Operating system: Linux debian 6.1.0-28-arm64 #​1 SMP Debian 6.1.119-1 (2024-11-22) aarch64
PHP 8.2.26 fpm-fcgi (Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apcu, bcmath, bz2, calendar, cgi-fcgi,
ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, igbinary, imap, intl, json, ldap, libxml,
mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, posix, random, readline, redis, session, shmop, soap, sockets, sodium,
standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="60" memory_limit="1024M" post_max_size="20M" safe_mode="" session.save_handler="files"
upload_max_filesize="6M"
disable_functions="pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,"

Software: Apache () Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.2 Safari/605.1.15 Server Software: Debian 12 Server Version: 10.11.6-MariaDB-0+deb12u1 Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION Parameters: verdanadesk_marciolocal@localhost/verdanadesk_marciolocal Host info: Localhost via UNIX socket

PHP version (8.2.26) is supported. Sessions configuration is OK. Allocated memory is sufficient. mysqli extension is installed. Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter. curl extension is installed. gd extension is installed. intl extension is installed. zlib extension is installed. The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present. Database engine version (10.11.6) is supported. No files from previous GLPI version detected. The log file has been created successfully. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_cache has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_cron has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_dumps has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_graphs has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_lock has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_pictures has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_plugins has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_rss has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_sessions has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_tmp has been validated. Write access to /home/marcio-local/public_html/verdanadesk/../../files/_uploads has been validated.

Web server root directory configuration seems safe. Sessions configuration is secured. OS and PHP are relying on 64 bits integers. exif extension is installed. ldap extension is installed. openssl extension is installed. Following extensions are installed: bz2, Phar, zip. Zend OPcache extension is installed. Following extensions are installed: ctype, iconv, mbstring, sodium. Write access to /home/marcio-local/public_html/verdanadesk/marketplace has been validated. Timezones seems loaded in database.

GLPI constants
 
GLPI_ROOT: "/home/marcio-local/public_html/verdanadesk"
GLPI_CONFIG_DIR: "/home/marcio-local/public_html/verdanadesk/../../config"
GLPI_VAR_DIR: "/home/marcio-local/public_html/verdanadesk/../../files"
GLPI_MARKETPLACE_DIR: "/home/marcio-local/public_html/verdanadesk/marketplace"
GLPI_USE_CSRF_CHECK: "1"
GLPI_CSRF_EXPIRES: "7200"
GLPI_CSRF_MAX_TOKENS: "100"
GLPI_USE_IDOR_CHECK: "1"
GLPI_IDOR_EXPIRES: "7200"
GLPI_ALLOW_IFRAME_IN_RICH_TEXT: false
GLPI_SERVERSIDE_URL_ALLOWLIST: ["/^(https?|feed):\/\/[^@:]+(\/.*)?$/"]
GLPI_TELEMETRY_URI: "https://telemetry.glpi-project.org"
GLPI_INSTALL_MODE: "GIT"
GLPI_NETWORK_MAIL: "[email protected]"
GLPI_NETWORK_SERVICES: "https://services.glpi-network.com"
GLPI_MARKETPLACE_ALLOW_OVERRIDE: true
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true
GLPI_USER_AGENT_EXTRA_COMMENTS: ""
GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: "1"
GLPI_AJAX_DASHBOARD: "1"
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_DEMO_MODE: "0"
GLPI_CENTRAL_WARNINGS: "1"
GLPI_TEXT_MAXSIZE: "4000"
GLPI_DOC_DIR: "/home/marcio-local/public_html/verdanadesk/../../files"
GLPI_CACHE_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_cache"
GLPI_CRON_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_cron"
GLPI_DUMP_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_dumps"
GLPI_GRAPH_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_graphs"
GLPI_LOCAL_I18N_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_locales"
GLPI_LOCK_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_lock"
GLPI_LOG_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_log"
GLPI_PICTURE_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_pictures"
GLPI_PLUGIN_DOC_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_plugins"
GLPI_RSS_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_rss"
GLPI_SESSION_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_sessions"
GLPI_TMP_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_tmp"
GLPI_UPLOAD_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_uploads"
GLPI_INVENTORY_DIR: "/home/marcio-local/public_html/verdanadesk/../../files/_inventories"
GLPI_NETWORK_REGISTRATION_API_URL: "https://services.glpi-network.com/api/registration/"
GLPI_MARKETPLACE_PLUGINS_API_URI: "https://services.glpi-network.com/api/marketplace/"
GLPI_I18N_DIR: "/home/marcio-local/public_html/verdanadesk/locales"
GLPI_VERSION: "10.0.17"
GLPI_SCHEMA_VERSION: "10.0.17@bde16719fbd4112f59a9a7d34c66c959bce73434"
GLPI_MARKETPLACE_PRERELEASES: false
GLPI_MIN_PHP: "7.4.0"
GLPI_MAX_PHP: "8.4.0"
GLPI_YEAR: "2024"

Libraries
 
htmlawed/htmlawed version 1.2.14 in (/home/marcio-local/public_html/verdanadesk/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.8.0 in (/home/marcio-local/public_html/verdanadesk/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/home/marcio-local/public_html/verdanadesk/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.4.4 in (/home/marcio-local/public_html/verdanadesk/plugins/pdf/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/home/marcio-local/public_html/verdanadesk/vendor/michelf/php-markdown/Michelf)
true/punycode in (/home/marcio-local/public_html/verdanadesk/vendor/true/punycode/src)
iamcal/lib_autolink in (/home/marcio-local/public_html/verdanadesk/vendor/iamcal/lib_autolink)
sabre/dav in (/home/marcio-local/public_html/verdanadesk/vendor/sabre/dav/lib/DAV)
sabre/http in (/home/marcio-local/public_html/verdanadesk/vendor/sabre/http/lib)
sabre/uri in (/home/marcio-local/public_html/verdanadesk/vendor/sabre/uri/lib)
sabre/vobject in (/home/marcio-local/public_html/verdanadesk/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/home/marcio-local/public_html/verdanadesk/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/home/marcio-local/public_html/verdanadesk/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/home/marcio-local/public_html/verdanadesk/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/home/marcio-local/public_html/verdanadesk/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/home/marcio-local/public_html/verdanadesk/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/home/marcio-local/public_html/verdanadesk/vendor/elvanto/litemoji/src)
symfony/console in (/home/marcio-local/public_html/verdanadesk/vendor/symfony/console)
scssphp/scssphp in (/home/marcio-local/public_html/verdanadesk/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/home/marcio-local/public_html/verdanadesk/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/home/marcio-local/public_html/verdanadesk/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/home/marcio-local/public_html/verdanadesk/vendor/rlanvin/php-rrule/src)
ramsey/uuid in (/home/marcio-local/public_html/verdanadesk/vendor/ramsey/uuid/src)
psr/log in (/home/marcio-local/public_html/verdanadesk/vendor/psr/log/Psr/Log)
psr/simple-cache in (/home/marcio-local/public_html/verdanadesk/vendor/psr/simple-cache/src)
psr/cache in (/home/marcio-local/public_html/verdanadesk/vendor/psr/cache/src)
league/csv in (/home/marcio-local/public_html/verdanadesk/vendor/league/csv/src)
mexitek/phpcolors in (/home/marcio-local/public_html/verdanadesk/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/home/marcio-local/public_html/verdanadesk/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/home/marcio-local/public_html/verdanadesk/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/home/marcio-local/public_html/verdanadesk/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/home/marcio-local/public_html/verdanadesk/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/home/marcio-local/public_html/verdanadesk/vendor/paragonie/sodium_compat/src)
symfony/cache in (/home/marcio-local/public_html/verdanadesk/vendor/symfony/cache)
html2text/html2text in (/home/marcio-local/public_html/verdanadesk/vendor/html2text/html2text/src)
symfony/css-selector in (/home/marcio-local/public_html/verdanadesk/vendor/symfony/css-selector)
symfony/dom-crawler in (/home/marcio-local/public_html/verdanadesk/vendor/symfony/dom-crawler)
twig/twig in (/home/marcio-local/public_html/verdanadesk/vendor/twig/twig/src)
twig/string-extra in (/home/marcio-local/public_html/verdanadesk/vendor/twig/string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 not found
symfony/polyfill-php81 not found
symfony/polyfill-php82 in (/home/marcio-local/public_html/verdanadesk/vendor/symfony/polyfill-php82)
league/oauth2-client in (/home/marcio-local/public_html/verdanadesk/vendor/league/oauth2-client/src/Provider)
league/oauth2-google in (/home/marcio-local/public_html/verdanadesk/vendor/league/oauth2-google/src/Provider)
thenetworg/oauth2-azure in (/home/marcio-local/public_html/verdanadesk/vendor/thenetworg/oauth2-azure/src/Provider)
phpCas version 1.6.0 in (/usr/share/php/CAS/source)

LDAP directories
 
Server: '51.222.143.132', Port: '389', BaseDN: 'dc=verdanadesk,dc=local', Connection filter:
'(&(objectClass=user)(objectCategory=person)(!(userAccountControl:1.2.840.113556.1.4.803:=2)))', RootDN:
'verdanadesk\administrator', Use TLS: none

SQL replicas
 
Not active

Notifications
 
Way of sending emails: SMTP+TLS ([email protected]@smtp.gmail.com)

Plugins list
 
remoteaccess         Name: Acesso Remoto                  Version: 2.0.0      State: Not installed
Install Method: Manual news Name: Alertas Version: 1.12.4 State: To update
Install Method: Manual applicationinterface Name: Application Interface Version: 1.2.0 State: Enabled
Install Method: Manual calendarhub Name: Calendar Hub Version: 1.1.0 State: Not installed
Install Method: Manual fields Name: Campos adicionais Version: 1.21.18 State: Enabled
Install Method: Manual behaviors Name: Comportamentos Version: 2.7.3 State: Enabled
Install Method: Manual archimap Name: Diagrams Version: 3.3.5 State: To update
Install Method: Manual formcreator Name: Form Creator Version: 2.13.9 State: Enabled
Install Method: Manual gantt Name: gantt Version: 1.1.0 State: Enabled
Install Method: Manual tag Name: Gerenciamento de Etiquetas Version: 2.12.1 State: Enabled
Install Method: Manual genericobject Name: Gerenciamento de objetos Version: 2.14.10 State: Enabled
Install Method: Manual glpiinventory Name: GLPI Inventory Version: 1.4.0 State: Enabled
Install Method: Manual datainjection Name: Importação de dados Version: 2.14.0 State: Enabled
Install Method: Manual pdf Name: Imprimir em PDF Version: 3.0.0 State: Enabled
Install Method: Manual seals Name: Lacres Version: 2.0.0 State: Enabled
Install Method: Manual mailanalyzer Name: Mail Analyzer Version: 3.2.0 State: Enabled
Install Method: Manual speedmeter Name: Medidor de Velocidades Version: 1.0.0 State: Enabled
Install Method: Manual messengerintegrator Name: Messenger Integrator Version: 2.8.2 State: To update
Install Method: Manual moreactions Name: More Actions Version: 3.3.0 State: Enabled
Install Method: Manual oauthimap Name: Oauth IMAP Version: 1.4.3 State: Enabled
Install Method: Manual utilsdashboards Name: Powerdash - Verdanatech Version: 2.2.0 State: Not installed
Install Method: Manual printoscloud Name: PrintOS - Cloud Version: 1.2.1 State: Enabled
Install Method: Manual projectup Name: Project Up Version: 2.0.0 State: Not installed
Install Method: Manual sapreset Name: SAP Reset Version: 1.0.0 State: Enabled
Install Method: Manual vauth Name: Serviços de Autenticação Version: 3.1.3 State: Enabled
Install Method: Manual vservices Name: Serviços Gerenciados Version: 2.3.1 State: Enabled
Install Method: Manual skins Name: Skins Version: 3.4.0 State: Enabled
Install Method: Manual softwarehomologated Name: Software Homologados Version: 2.0.0 State: Not installed
Install Method: Manual vclone Name: vclone Version: 2.0.0 State: Not installed
Install Method: Manual chat Name: Verdana Chat Version: 12.4.1 State: Enabled
Install Method: Manual vgmud Name: Verdanatech GMUD Version: 2.0.0 State: Not installed
Install Method: Manual vreports Name: vreports Version: 6.2.1 State: Enabled
Install Method: Manual vterm Name: Vterms Version: 1.0.0 State: Not installed
Install Method: Manual

Anything else?

No response

verdanatech-marcio avatar Jan 30 '25 15:01 verdanatech-marcio

Hi @verdanatech-marcio can you try this -> https://github.com/pluginsGLPI/tag/pull/220

Best regards

stonebuzz avatar Jan 31 '25 09:01 stonebuzz

I applied this fix but it still doesn't work as expected.

verdanatech-marcio avatar Jan 31 '25 16:01 verdanatech-marcio

Hi @verdanatech-marcio

Is the rule (for tickets) correctly configured to be played when a ticket is created or updated?

stonebuzz avatar Feb 03 '25 08:02 stonebuzz

Hi @stonebuzz yes the rule is configured correctly.

verdanatech-marcio avatar Feb 03 '25 11:02 verdanatech-marcio

Any news or answers to this case?

verdanatech-marcio avatar Feb 19 '25 14:02 verdanatech-marcio

Hi @stonebuzz Any news or answers to this case?

verdanatech-marcio avatar Mar 05 '25 14:03 verdanatech-marcio

I am also facing the same issue. The rule was applied ony in ticket creation and not in ticket update.

Additionally I noticed that it is not possible to add 2 or more tags in the same rule, only one tag. And when we split in several rules (for instance 3 rules to add 3 tags) when the 3 rules are applicable to the same ticket, the ticket is updated only with the tag of the last rule, it means, it is not adding the new tags, but replacing the one tag that was added in the previous rule.

For example:

Categories: "Correct security issues in Linux Server". "Correct security issues in Windows Server".

The rules are set in Add/Update ticket:

  • If category = "Correct security issues in Linux Server", add tag "Security".
  • If category = "Correct security issues in Windows Server", add tag "Security".
  • If category = "Correct security issues in Linux Server", add tag "Linux".
    • If category = "Correct security issues in Windows Server", add tag "Windows".

A new issue was added with category = "Correct security issues in Linux Server", and should be set with the tags "Security" AND "Linux", but currently when executed both rules, the issue is set only with "Linux". When I remove the Linux rule, the added issue was set with "Security" rule. It means that the rule is replacing/subscribing all tags ofthe ticket, instead of add a new tag and maintain the old tags previous existent.

ferstring avatar Mar 24 '25 18:03 ferstring

Any news or answers to this case?

verdanatech-marcio avatar Apr 28 '25 10:04 verdanatech-marcio

Any news or answers to this case?

verdanatech-marcio avatar May 12 '25 11:05 verdanatech-marcio

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue. If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

github-actions[bot] avatar Jun 06 '25 08:06 github-actions[bot]