Skip to content

Instantly share code, notes, and snippets.

@nickname55
nickname55 / git-clear-cache.sh
Created November 13, 2022 12:50 — forked from joemaffia/git-clear-cache.sh
Clear git cache
git rm -r --cached .
git add .
git commit -m 'git cache cleared'
git push

JQL Syntax for the Impatient

There are a few JQL syntax bits to get you started:

  • AND --- allows you to add qualifiers to a list
  • != Thing --- target one thing
  • is in (List, Of, Things) --- target a bunch of things (Done, Closed, Resolved) typically
  • not in (List, of, Things) --- do not include a bunch of things
  • -1w --- relative time. You can also use -1d for day
  • "2015/3/15" --- specific dates
@nickname55
nickname55 / 1.http
Last active October 9, 2022 11:57
flowXo api. get messages
GET https://flowxo.com/api/conversations/615c6b5e14fc0900a6556061%2Fc%2FMwvFx5eJp/messages?skip=0&limit=1000
Accept: application/json
Authorization: Bearer *****
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.builder.JqlQueryBuilder
import com.atlassian.jira.util.thread.JiraThreadLocalUtils
def searchService = ComponentAccessor.getComponent(SearchService)
def customFieldManager = ComponentAccessor.customFieldManager
def storyPointsCf = customFieldManager.getCustomFieldObjectByName('Story Points')
def issue = event.issue
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.ModifiedValue
import com.atlassian.jira.issue.util.DefaultIssueChangeHolder
import com.atlassian.jira.component.ComponentAccessor
def issue = event.issue as Issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def tgtField = customFieldManager.getCustomFieldObjects(event.issue).find {it.name == "My CustomField"}
def changeHolder = new DefaultIssueChangeHolder()
tgtField.updateValue(null, issue, new ModifiedValue(issue.getCustomFieldValue(tgtField), "myvalue"),changeHolder)
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField
def date2 = new Date() //.plus(3)
def dateField = getFieldById(fieldChanged)
def dateValue = dateField.value as Date
dateField.clearError()
if (dateValue < date2) {
import groovy.json.JsonParserType
import groovy.json.JsonSlurper
def commentProperties = transientVars["commentProperty"] as String[]
if (commentProperties && commentProperties.size() > 0) {
log.debug commentProperties.join(", ");
def isInternalComment = false
import com.atlassian.jira.issue.attachment.Attachment;
import com.atlassian.jira.issue.AttachmentManager;
import com.atlassian.jira.component.ComponentAccessor;
AttachmentManager attachmentManager = ComponentAccessor.getAttachmentManager();
List<Attachment> attachments = attachmentManager.getAttachments(issue);
long size = 0l;
for (Attachment at:
attachments) {
size += at.getFilesize();
@nickname55
nickname55 / IsNullOrEmpty.Groovy
Created April 17, 2022 18:28 — forked from ismits/IsNullOrEmpty.Groovy
Is null or empty check in Groovy
if (!someString?.trim()) {
logger.lifecycle("the string is null or empty.")
}