Thanks for your comments, it helped me a lot. Yes map between article’s category and ticket category is 1:1.
I managed to write a scrip with a working condition (namely when a category is changed).
However, I have a few issues with the action part. I want to add a link to an article based on the new value of the category field. This would work as follows:
In the tickets, I have a customfield called ‘Category’ with several custom values. For each of these values there is a name and an ID.
On the other hand, for the articles I also have a customfield called ‘Category’ , which is just a name.
Now whenever a category of a ticket is changed, I would add a link to the article with the same category as the new value of the category of the ticket.
The AddLink method can be used to create a link from the scrip of a ticket to the article of my choosing. However, when I create this link, the article parameter is given by ’ a:[id]’ , where [id] is the id of the article. At this point, I have managed to retrieve the new value of the category of the ticket, but I do not know how to retrieve the id of the article with the same category.
This is the code I used to retrieve the new and old category values.
my $oldcat= $self->TransactionObj->OldValue;
my $newcat= $self->TransactionObj->NewValue;