How to use the pyotrs.DynamicField function in pyotrs

To help you get started, we’ve selected a few pyotrs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rapid7 / insightconnect-plugins / otrs / komand_otrs / actions / update / action.py View on Github external
for attachment in new_attachments:
                filename = attachment['filename']
                content = attachment['content']
                mimetype = mimetypes.guess_type(filename)
                attachments.append(Attachment.create_basic(Content=content,
                                                           ContentType=
                                                           mimetype[0],
                                                           Filename=filename))

        ticket_id = params.get('TicketID')
        del(params["TicketID"])

        dynamic_fields = []
        for fields in new_dynamic_fields:
            dynamic_fields.append(DynamicField(**fields))

        #  Pending time
        if params.get("PendingTime").startswith("0001-01-01"):
            del(params['PendingTime'])
        else:
            # Format date
            PyOTRSUtils.add_pendingtime(self, client, params.get("PendingTime"), ticket_id)
            del(params['PendingTime'])

        other_options = params

        if no_article:
            # If attachment exists it will add default Article
            if other_options.get("Attachments"):
                del other_options["Attachments"]
github rapid7 / insightconnect-plugins / otrs / komand_otrs / actions / create / action.py View on Github external
        dynamic_fields = list(map(lambda f: DynamicField(**f), new_dynamic_fields))
        # create ticket from basics and all other params

pyotrs

Python wrapper for OTRS (using REST API)

MIT
Latest version published 7 months ago

Package Health Score

53 / 100
Full package analysis