Method create ticket
777677
def extract_ticket(response)
      data = JSON.parse(response.body)
      ticket = data['data']['ticket']
      csrf_prevention_token = data['data']['CSRFPreventionToken']
      unless ticket.nil?
        token = 'PVEAuthCookie=' + ticket.gsub!(/:/, '%3A').gsub!(/=/, '%3D')
      end
      @connection_status = 'connected'
      {
        CSRFPreventionToken: csrf_prevention_token,
        cookie: token
      }
    end
507402
@PostMapping(value = "/v1/tickets", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    public ResponseEntity<String> createTicketGrantingTicket(@RequestBody(required=false) final MultiValueMap<String, String> requestBody,
                                                             final HttpServletRequest request) {
        try {
            val tgtId = createTicketGrantingTicketForRequest(requestBody, request);
            return createResponseEntityForTicket(request, tgtId);
        } catch (final AuthenticationException e) {
            return RestResourceUtils.createResponseEntityForAuthnFailure(e, request, applicationContext);
        } catch (final BadRestRequestException e) {
            LOGGER.error(e.getMessage(), e);
            return new ResponseEntity<>(e.getMessage(), HttpStatus.BAD_REQUEST);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
            return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        }
    }
408094
def cli(env, title, subject_id, body, hardware_identifier, virtual_identifier, priority):
    """"""
    ticket_mgr = SoftLayer.TicketManager(env.client)

    if body is None:
        body = click.edit('\n\n' + ticket.TEMPLATE_MSG)
    created_ticket = ticket_mgr.create_ticket(
        title=title,
        body=body,
        subject=subject_id,
        priority=priority)

    if hardware_identifier:
        hardware_mgr = SoftLayer.HardwareManager(env.client)
        hardware_id = helpers.resolve_id(hardware_mgr.resolve_ids, hardware_identifier, 'hardware')
        ticket_mgr.attach_hardware(created_ticket['id'], hardware_id)

    if virtual_identifier:
        vs_mgr = SoftLayer.VSManager(env.client)
        vs_id = helpers.resolve_id(vs_mgr.resolve_ids, virtual_identifier, 'VS')
        ticket_mgr.attach_virtual_server(created_ticket['id'], vs_id)

    env.fout(ticket.get_ticket_results(ticket_mgr, created_ticket['id']))
942321
def channels_twitter_ticket_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/channels/twitter/tickets.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
694812
def tickets_create_many(self, data, **kwargs):
        ""
        api_path = "/api/v2/tickets/create_many.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
832815
public Map<String, AttributeValue> buildTableAttributeValuesMapFromTicket(final Ticket ticket, final Ticket encTicket) {
        val values = new HashMap<String, AttributeValue>();
        values.put(ColumnNames.ID.getColumnName(), new AttributeValue(encTicket.getId()));
        values.put(ColumnNames.PREFIX.getColumnName(), new AttributeValue(ticket.getPrefix()));
        values.put(ColumnNames.CREATION_TIME.getColumnName(), new AttributeValue(ticket.getCreationTime().toString()));
        values.put(ColumnNames.COUNT_OF_USES.getColumnName(), new AttributeValue().withN(Integer.toString(ticket.getCountOfUses())));
        values.put(ColumnNames.TIME_TO_LIVE.getColumnName(), new AttributeValue().withN(Long.toString(ticket.getExpirationPolicy().getTimeToLive())));
        values.put(ColumnNames.TIME_TO_IDLE.getColumnName(), new AttributeValue().withN(Long.toString(ticket.getExpirationPolicy().getTimeToIdle())));
        values.put(ColumnNames.ENCODED.getColumnName(), new AttributeValue().withB(ByteBuffer.wrap(SerializationUtils.serialize(encTicket))));
        LOGGER.debug("Created attribute values [{}] based on provided ticket [{}]", values, encTicket.getId());
        return values;
    }
269867
private function setTicket($type=false,$ticket,$appId)
	{
		$name = $this->_config['ticketName'];

		if($type){
			// add client info to old ticket
			if(!array_search($appId,$ticket['clients']))
				$ticket['clients'][] = $appId;
			$ticket['check_at'] = time();
			setcookie($name,$ticket);
			$_SESSION[$name] = $ticket;
		}else{
			// new ticket
			$expire_time = (int)$ticket['expire_time'];
			setcookie($name."['id']",$ticket['id'],time()+$expire_time);
			setcookie($name."['create_at']",$ticket['create_at'],time()+$expire_time);
			setcookie($name."['expire_time']",$ticket['expire_time'],time()+$expire_time);
			setcookie($name."['check_at']",$ticket['check_at'],time()+$expire_time);
			$i = 0;
			foreach($ticket['clients'] as $client){
				setcookie($name.'[\'clients\']['.$i.']',$client,time()+$expire_time);
				$i++;
			}
			setcookie($name."['user']",$ticket['user']); //debug
			$_SESSION[$name] = $ticket;
		}
	}
916300
public int execute()
    {
        int executed = 0;
        final long now = now();
        sortIfNeeded();
        Set<Ticket> cancelled = new HashSet<>();
        for (Ticket ticket : this.tickets) {
            if (now - ticket.start < ticket.delay) {
                // tickets are ordered, not meeting the condition means the next ones do not as well
                break;
            }
            if (!ticket.alive) {
                //  Dead ticket, let's continue
                cancelled.add(ticket);
                continue;
            }
            ticket.alive = false;
            cancelled.add(ticket);
            ticket.handler.time(ticket.args);
            ++executed;
        }
        for (int idx = tickets.size(); idx-- > 0; ) {
            Ticket ticket = tickets.get(idx);
            if (ticket.alive) {
                break;
            }
            cancelled.add(ticket);
        }
        this.tickets.removeAll(cancelled);
        cancelled.clear();
        return executed;
    }
306528
function getSubmissionTicket() {
		if (isset($this->submission) && isset($this->submission->ticket)) {
			return $this->submission->ticket;
		} else {
			throw new Exception("Submission not initialized");
		}
	}
653745
public function createTicketFile()
    {
        // Find or make a folder
        $folder = $this->fileFolder();
        $relativeFilePath = "/{$folder->Filename}{$this->TicketCode}.pdf";
        $absoluteFilePath = Director::baseFolder() . $relativeFilePath;

        if (!$this->TicketQRCode()->exists()) {
            $this->createQRCode();
        }

        if (!$file = File::get()->find('Filename', $relativeFilePath)) {
            $file = File::create();
            $file->ParentID = $folder->ID;
            $file->OwnerID = (Member::currentUser()) ? Member::currentUser()->ID : 0;
            $file->Title = $this->TicketCode;
            $file->setFilename($relativeFilePath);
            $file->write();
        }

        // Set the template and parse the data
        $template = new SSViewer('PrintableTicket');
        $html = $template->process($this->data());// getViewableData());

        // Create a DomPDF instance
        $domPDF = new Dompdf();
        $domPDF->loadHtml($html);
        $domPDF->setPaper('A4');
        $domPDF->getOptions()->setDpi(150);
        $domPDF->render();

        // Save the pdf stream as a file
        file_put_contents($absoluteFilePath, $domPDF->output());

        // Attach the ticket file to the Attendee
        $this->TicketFileID = $file->ID;
        $this->write();

        return $file;
    }
526719
function __fetchTicketInfo(server, ticketid, callback) {

    assert(server.cache_folder);

    var filename = server._ticket_cache_file(ticketid);
    //xx console.log("filename " , filename.red);

    assert(_.isFunction(callback));

    var command = 'issues/' + ticketid.toString() + '.json?include=relations,journals';

    perform_http_get_transaction(server,command, function (err, txt) {

        txt = fixUnicode(txt);

        var ticket = null;
        try {
            var o = JSON.parse(txt);

            fs.writeFileSync(filename, JSON.stringify(o, null, " "));
            console.warn(" writing ", filename);
            ticket= o.issue;
        } catch (err) {
            console.log("error !".red, err.message);
            fs.writeFileSync("toto.txt", txt);
            callback(err);
            return;
            // the ticket may have been deleted
        }
        callback(null,ticket);

    });

}
1257845
def call(self, method, args={}, retry=False, retry_policy=None,
             ticket=None, **props):
        """"""
        ticket = ticket or uuid()
        reply_q = self.get_reply_queue(ticket)
        self.cast(method, args, declare=[reply_q], reply_to=ticket, **props)
        return self.AsyncResult(ticket, self)
1248517
def update_ticket(self, ticket_id, **kwargs):
        """"""
        url = 'tickets/%d' % ticket_id
        ticket = self._api._put(url, data=json.dumps(kwargs))
        return Ticket(**ticket)
1663
def get_ticket(self, service):
        """"""
        return self.auth_tickets \
            .filter(expires__gt=datetime.now(timezone.utc), service=service) \
            .last()
234798
def ticket_satisfaction_rating_create(self, ticket_id, data, **kwargs):
        ""
        api_path = "/api/v2/tickets/{ticket_id}/satisfaction_rating.json"
        api_path = api_path.format(ticket_id=ticket_id)
        return self.call(api_path, method="POST", data=data, **kwargs)
386152
def create_ticket(self, subject, **kwargs):
        

        url = 'tickets'
        status = kwargs.get('status', 2)
        priority = kwargs.get('priority', 1)
        data = {
            'subject': subject,
            'status': status,
            'priority': priority,
        }
        data.update(kwargs)
        if 'attachments' in data:
            ticket = self._create_ticket_with_attachment(url, data)
            return Ticket(**ticket)

        ticket = self._api._post(url, data=json.dumps(data))
        return Ticket(**ticket)
781422
def create_comment(ticket_id, input, options = {})
      make_request("tickets/#{ticket_id}", ({:update => Zendesk::Main.to_xml('comment', input)}), options)
    end