Example #1
0
def test_create_ticket_without_template(base_app, appctx):
    control_number = 1
    rt_queue = "TEST"
    ticket_id = create_ticket(
        rt_queue,
        "*****@*****.**",
        "This is a test description by Jessica Jones.",
        "This is a test subject by Jessica Jones.",
        control_number,
    )

    assert ticket_id != -1
Example #2
0
def test_create_ticket_with_empty_owner(inspire_app):
    control_number = 1885350
    rt_queue = "TEST"
    ticket_id = create_ticket(
        rt_queue,
        "*****@*****.**",
        "This is a test description by Jessica Jones.",
        "This is a test subject by Jessica Jones.",
        control_number,
        Owner=None,
    )

    assert ticket_id
Example #3
0
def create_rt_ticket(endpoint, pid_value):
    """View to create an rt ticket"""
    json = request.json
    ticket_id = tickets.create_ticket(
        json["queue"],
        current_user.email,
        json.get("description"),
        json.get("subject"),
        pid_value,
        Owner=json.get("owner"),
    )
    if ticket_id != -1:
        return jsonify(
            success=True,
            data={
                "id": str(ticket_id),
                "link": tickets.get_rt_link_for_ticket(ticket_id),
            },
        )
    else:
        return jsonify(success=False), 500