Set the title and ticket code before writing
512870
public function onBeforeWrite()
    {
        // Set the title of the attendee
        $this->Title = $this->getName();

        // Generate the ticket code
        if ($this->exists() && empty($this->TicketCode)) {
            $this->TicketCode = $this->generateTicketCode();
        }

        if (
            $this->getEmail()
            && $this->getName()
            && !$this->TicketFile()->exists()
            && !$this->TicketQRCode()->exists()
        ) {
            $this->createQRCode();
            $this->createTicketFile();
        }

        if ($fields = $this->Fields()) {
            foreach ($fields as $field) {
                if ($value = $this->{"$field->Name[$field->ID]"}) {
                    //$cache = self::getCacheFactory();
                    //$cache->save(serialize($value), $this->getFieldCacheKey($field));
                    $fields->add($field->ID, array('Value' => $value));
                }
            }
        }

        parent::onBeforeWrite();
    }
1234329
protected function setTitleEditCurrency()
    {
        if (isset($this->data_currency['code'])) {
            $title = $this->text('Edit %name', array('%name' => $this->data_currency['name']));
        } else {
            $title = $this->text('Add currency');
        }

        $this->setTitle($title);
    }
1291882
function setDirtyIndicator(isDirty) {
		if (title) {
			if (title.charAt(0) === '*' && !isDirty) {
				title = title.substring(1);
			}
			if (isDirty && title.charAt(0) !== '*') {
				title = '*' + title;
			}
			window.document.title = title;
		}
	}
190810
def cli(env, identifier, path, name):
    """"""
    mgr = SoftLayer.TicketManager(env.client)

    ticket_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'ticket')

    if path is None:
        raise exceptions.ArgumentError("Missing argument --path")

    if not os.path.exists(path):
        raise exceptions.ArgumentError("%s not exist" % path)

    if name is None:
        name = os.path.basename(path)

    attached_file = mgr.upload_attachment(ticket_id=ticket_id,
                                          file_path=path,
                                          file_name=name)
    env.fout("File attached: \n%s" % attached_file)
18826
def update_title(self, _, info):
        # type: (object, TitleInfo) -> None
        """"""
        with self._lock:
            self._block.meta.set_label(info.title)
1328544
def set_title(self, index, title):
        
        # JSON dictionaries have string keys, so we convert index to a string
        index = unicode_type(int(index))
        self._titles[index] = title
        self.send_state('_titles')
25398
def create_ticket(subject, tags, ticket_body, requester_email=None,
                  custom_fields=[]):
    

    payload = {'ticket': {
        'subject': subject,
        'comment': {
            'body': ticket_body
        },
        'group_id': settings.ZENDESK_GROUP_ID,
        'tags': tags,
        'custom_fields': custom_fields
    }}

    if requester_email:
        payload['ticket']['requester'] = {
            'name': 'Sender: %s' % requester_email.split('@')[0],
            'email': requester_email,
        }
    else:
        payload['ticket']['requester_id'] = settings.ZENDESK_REQUESTER_ID

    requests.post(
        get_ticket_endpoint(),
        data=json.dumps(payload),
        auth=zendesk_auth(),
        headers={'content-type': 'application/json'}).raise_for_status()
729156
def write_title(self, title, level=1, id=None):
        
        if id:
            self.write('<h{lv} id="{id}">{title}</h{lv}>',
                       title=title, lv=level, id=id)
        else:
            self.write('<h{lv}>{title}</h{lv}>',
                       title=title, lv=level)
928731
def addTitle(self, title, titleAlignments):
        
        if title in self:
            raise KeyError('Title %r already present in TitlesAlignments '
                           'instance.' % title)
        else:
            self[title] = titleAlignments
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)
202431
public void setAutoSetTitle(String autoSetTitle) {

        m_autoSetTitle = Boolean.valueOf(autoSetTitle).booleanValue();
        if (LOG.isDebugEnabled()) {
            LOG.debug(Messages.get().getBundle().key(Messages.LOG_SET_AUTO_TITLE_1, autoSetTitle));
        }
    }
765495
private void updateTitle() {
		String title;

		if (this.getCurrentComponent() == null) {
			title = "Example Picker";
		} else {
			title = this.getCurrentComponent().getClass().getName();
		}

		WApplication app = WebUtilities.getAncestorOfClass(WApplication.class, this);

		if (app != null) {
			app.setTitle(title);
		}
	}
767175
def zapier_cancel_hook(request):
    '''
    
    '''
    if request.META.get('HTTP_X_ZAPIER_SECRET', None) != settings.WAFER_TICKETS_SECRET:
        raise PermissionDenied('Incorrect secret')

    # This is required for python 3, and in theory fine on python 2
    payload = json.loads(request.body.decode('utf8'))
    ticket = Ticket.objects.filter(barcode=payload['barcode'])
    if ticket.exists():
        # delete the ticket
        ticket.delete()
    return HttpResponse("Cancelled\n", content_type='text/plain')
177030
private void setTitleOfLayoutHeader() {
        titleOfArtifactDetails.setValue(HawkbitCommonUtil.getArtifactoryDetailsLabelId("", i18n));
        titleOfArtifactDetails.setContentMode(ContentMode.HTML);
    }
1067467
function _initOverwriteMode(currentEditor) {
        currentEditor.toggleOverwrite($statusOverwrite.text() === Strings.STATUSBAR_OVERWRITE);
        $statusOverwrite.attr("title", Strings.STATUSBAR_INSOVR_TOOLTIP);
    }
888482
def setWindowTitle(self, newTitle=''):
        """"""
        title = 'Rampage - ' + newTitle
        super(MainWindow, self).setWindowTitle(title)
786506
def __set_window_title(self):
        

        if self.has_editor_tab():
            windowTitle = "{0} - {1}".format(self.__default_window_title, self.get_current_editor().file)
        else:
            windowTitle = "{0}".format(self.__default_window_title)

        LOGGER.debug("> Setting 'Script Editor' window title to '{0}'.".format(windowTitle))
        self.setWindowTitle(windowTitle)