Hello!
Is it possible to make a copy of FAQ article with all the linked tickets and CI's and edit only some fields, like solution and name? Maybe some API function or maybe SQL query to make a copy?
Thanks in Advance!
Artjoms.
Make a copy of FAQ Article
Moderator: crythias
-
artjoms15
- Znuny advanced
- Posts: 121
- Joined: 30 Aug 2011, 10:48
- Znuny Version: 3.3.8 && 4.0.9
- Real Name: Artjoms Petrovs
- Location: Latvia
Make a copy of FAQ Article
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
-
artjoms15
- Znuny advanced
- Posts: 121
- Joined: 30 Aug 2011, 10:48
- Znuny Version: 3.3.8 && 4.0.9
- Real Name: Artjoms Petrovs
- Location: Latvia
Re: Make a copy of FAQ Article
And a small update to this one - is it possible to duplicate a Configuration Item with all the linked tickets and other configuration items kept intact?
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
-
crythias
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Make a copy of FAQ Article
A link isn't adequate? (Hyper or otherwise?)
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
-
artjoms15
- Znuny advanced
- Posts: 121
- Joined: 30 Aug 2011, 10:48
- Znuny Version: 3.3.8 && 4.0.9
- Real Name: Artjoms Petrovs
- Location: Latvia
Re: Make a copy of FAQ Article
I will try to explain the idea -
I am trying to create a module which keeps track of all granted access rights to a Customer (internal Customers)
For now I decided to make an object linked to each Customer by his login, and it can be either a FAQ article or a Configuration Item entry (even more preferable). Access rights are defined as Configuration Items and linked to according Customer Object, thus showing what systems does he have access at any moment. Adding or removing any access rights will reflect in adding or removing a Configuration Item -this process is working like a charm and is understandable and simple... BUT... if a new user appears or he changes his work position then ALL the links must be manually recreated and it is really hard work. What I want achieve is to give a possibility to choose a reference user and just make a copy of his Object with all the links, and after that make only some minor changes according to his work specialities. And yeah, A possibility to his manager (in the Customer frontend) is given to edit require Acces rights (Module AgentITSMChangeEdit.pm adapted to Customer Frontend).
Well, I think that shows, that an ordinary link won' t be enough to make unique combinations for each Customer
For the moment I am browsing through API and inspecting all the functions, but it seems that there is no such functionality (too difficult to implement on DB level?!)
I am trying to create a module which keeps track of all granted access rights to a Customer (internal Customers)
For now I decided to make an object linked to each Customer by his login, and it can be either a FAQ article or a Configuration Item entry (even more preferable). Access rights are defined as Configuration Items and linked to according Customer Object, thus showing what systems does he have access at any moment. Adding or removing any access rights will reflect in adding or removing a Configuration Item -this process is working like a charm and is understandable and simple... BUT... if a new user appears or he changes his work position then ALL the links must be manually recreated and it is really hard work. What I want achieve is to give a possibility to choose a reference user and just make a copy of his Object with all the links, and after that make only some minor changes according to his work specialities. And yeah, A possibility to his manager (in the Customer frontend) is given to edit require Acces rights (Module AgentITSMChangeEdit.pm adapted to Customer Frontend).
Well, I think that shows, that an ordinary link won' t be enough to make unique combinations for each Customer
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
-
crythias
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: Make a copy of FAQ Article
My immediate reaction was to create (a blank) destination object by API to get a new id number then
for each tables that's linked as table:
Insert into table (entry_id, field1, field2 ....) select 'newentryid', table.field1, table.field2, ... FROM table WHERE table.entry_id='sourceentryid';
You should back up your database before trying such things and read up on Insert-select
Terms used:
entry_id = The primary key field referencing the master object (FAQ/Configuration Item)
tables that's linked = based upon schema, every table that references the entry_id field
newentryid = the primary key value on creation of the new destination object
sourceentryid = the original key value of the source object.
Standard disclaimer applies:
backup first.
You're on your own if this doesn't work, though it has a decent likelihood of being the answer.
Test on a test system. Understand the documentation.
for each tables that's linked as table:
Insert into table (entry_id, field1, field2 ....) select 'newentryid', table.field1, table.field2, ... FROM table WHERE table.entry_id='sourceentryid';
You should back up your database before trying such things and read up on Insert-select
Terms used:
entry_id = The primary key field referencing the master object (FAQ/Configuration Item)
tables that's linked = based upon schema, every table that references the entry_id field
newentryid = the primary key value on creation of the new destination object
sourceentryid = the original key value of the source object.
Standard disclaimer applies:
backup first.
You're on your own if this doesn't work, though it has a decent likelihood of being the answer.
Test on a test system. Understand the documentation.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
-
artjoms15
- Znuny advanced
- Posts: 121
- Joined: 30 Aug 2011, 10:48
- Znuny Version: 3.3.8 && 4.0.9
- Real Name: Artjoms Petrovs
- Location: Latvia
Re: Make a copy of FAQ Article
Thanks Crythias!
Although I found required functions in API
LinkObject.pm
Retrieve all links of a ConfigItem
then in a loop traverse the hash $LinkList and set it to a newly created ConfigItem via
And it also does the trick.
Although I found required functions in API
LinkObject.pm
Code: Select all
$LinkList = LinkList()
# get all existing links for a given object
then in a loop traverse the hash $LinkList and set it to a newly created ConfigItem via
Code: Select all
my $True = $Self->{LinkObject}->LinkAdd(
SourceObject => 'ITSMConfigItem',
SourceKey => $NewAccessCard,
TargetObject => 'ITSMConfigItem',
TargetKey => $LinkList{$key}{$subkey},
Type => 'DependsOn',
State => 'Valid',
UserID => 1,
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer