You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-03-21 11:35:28

SomeDude
Member
Registered: 2023-11-22
Posts: 62

How to change the Person writing Followups with API Import

Hello,

I am currently Importing our old Tickets to GLPI via API and I have the Problem hat the Ticket and the Follow ups are written by me.

What Code do I have to add to change the writer of those Messages for example in here

´´´
def zammad_ticket_message_to_glpi_followup(ticket_message_body: str, base_ticket_id: int) -> typing.Dict:
    return {
        "itemtype": "Ticket",
        'items_id': base_ticket_id,
        'content': ticket_message_body,
        'is_private': 0,
        "requesttypes_id": 1,
        "sourceitems_id": 0,
        "sourceof_items_id": 0
    }
´´´

Offline

#2 2024-03-21 17:38:38

marionmayn
Member
Registered: 2024-03-21
Posts: 4

Re: How to change the Person writing Followups with API Import

def zammad_ticket_message_to_glpi_followup(ticket_message_body: str, base_ticket_id: int, writer_user_id: int) -> typing.Dict:
    return {
        "itemtype": "Ticket",
        'items_id': base_ticket_id,
        'content': ticket_message_body,
        'is_private': 0,
        'users_id': writer_user_id,  # Specify the ID of the user who wrote the message
        "requesttypes_id": 1,
        "sourceitems_id": 0,
        "sourceof_items_id": 0
    }

Offline

#3 2024-03-22 09:43:01

SomeDude
Member
Registered: 2023-11-22
Posts: 62

Re: How to change the Person writing Followups with API Import

Thank you very much

Offline

Board footer

Powered by FluxBB