Add support for silent mode.
Fixes #13 partially. Only missing STDIN reading as a special file.
This commit is contained in:
parent
edc5120921
commit
7f8947b970
9 changed files with 188 additions and 125 deletions
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"errors"
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"fmt"
|
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
||||||
"otremblay.com/jkl"
|
"otremblay.com/jkl"
|
||||||
|
|
@ -17,6 +17,7 @@ type CreateCmd struct {
|
||||||
project string
|
project string
|
||||||
file string
|
file string
|
||||||
issuetype string
|
issuetype string
|
||||||
|
silent bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewCreateCmd(args []string) (*CreateCmd, error) {
|
func NewCreateCmd(args []string) (*CreateCmd, error) {
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"text/template"
|
"text/template"
|
||||||
|
|
@ -21,9 +22,9 @@ func NewEditCmd(args []string) (*EditCmd, error) {
|
||||||
ccmd := &EditCmd{project: os.Getenv("JIRA_PROJECT")}
|
ccmd := &EditCmd{project: os.Getenv("JIRA_PROJECT")}
|
||||||
f := flag.NewFlagSet("x", flag.ExitOnError)
|
f := flag.NewFlagSet("x", flag.ExitOnError)
|
||||||
f.StringVar(&ccmd.project, "p", "", "Jira project key")
|
f.StringVar(&ccmd.project, "p", "", "Jira project key")
|
||||||
f.StringVar(&ccmd.file, "f", "filename", "File to get issue description from")
|
f.StringVar(&ccmd.file, "f", "", "File to get issue description from")
|
||||||
f.Parse(args)
|
f.Parse(args)
|
||||||
ccmd.taskKey = flag.Arg(0)
|
ccmd.taskKey = f.Arg(0)
|
||||||
return ccmd, nil
|
return ccmd, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -31,7 +32,7 @@ func (ecmd *EditCmd) Edit() error {
|
||||||
b := bytes.NewBuffer(nil)
|
b := bytes.NewBuffer(nil)
|
||||||
iss, err := jkl.GetIssue(ecmd.taskKey)
|
iss, err := jkl.GetIssue(ecmd.taskKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("Edit failed: %v", err)
|
||||||
}
|
}
|
||||||
err = editTmpl.Execute(b, iss)
|
err = editTmpl.Execute(b, iss)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -42,12 +43,12 @@ func (ecmd *EditCmd) Edit() error {
|
||||||
iss, err = GetIssueFromFile(ecmd.file, b, iss.EditMeta)
|
iss, err = GetIssueFromFile(ecmd.file, b, iss.EditMeta)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("Error getting issue from file: %v", err)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
iss, err = GetIssueFromTmpFile(b, iss.EditMeta)
|
iss, err = GetIssueFromTmpFile(b, iss.EditMeta)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return fmt.Errorf("Error getting issue from temp file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import (
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"unicode"
|
||||||
|
|
||||||
"reflect"
|
"reflect"
|
||||||
|
|
||||||
|
|
@ -17,6 +18,7 @@ import (
|
||||||
|
|
||||||
"otremblay.com/jkl"
|
"otremblay.com/jkl"
|
||||||
)
|
)
|
||||||
|
|
||||||
// def get_editor do
|
// def get_editor do
|
||||||
// [System.get_env("EDITOR"), "nano", "vim", "vi"]
|
// [System.get_env("EDITOR"), "nano", "vim", "vi"]
|
||||||
// |> Enum.find(nil, fn (ed) -> System.find_executable(ed) != nil end)
|
// |> Enum.find(nil, fn (ed) -> System.find_executable(ed) != nil end)
|
||||||
|
|
@ -42,12 +44,12 @@ func copyInitial(dst io.WriteSeeker, initial io.Reader) {
|
||||||
func GetIssueFromTmpFile(initial io.Reader, editMeta *jkl.EditMeta) (*jkl.JiraIssue, error) {
|
func GetIssueFromTmpFile(initial io.Reader, editMeta *jkl.EditMeta) (*jkl.JiraIssue, error) {
|
||||||
f, err := ioutil.TempFile(os.TempDir(), "jkl")
|
f, err := ioutil.TempFile(os.TempDir(), "jkl")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("Error opening tempfile: %v", err)
|
||||||
}
|
}
|
||||||
copyInitial(f, initial)
|
copyInitial(f, initial)
|
||||||
f2, err := GetTextFromFile(f)
|
f2, err := GetTextFromFile(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, fmt.Errorf("Error reading tempfile: %v", err)
|
||||||
}
|
}
|
||||||
return IssueFromReader(f2, editMeta), nil
|
return IssueFromReader(f2, editMeta), nil
|
||||||
}
|
}
|
||||||
|
|
@ -73,6 +75,8 @@ func GetTextFromSpecifiedFile(filename string, initial io.Reader) (io.Reader, er
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetTextFromFile(file *os.File) (io.Reader, error) {
|
func GetTextFromFile(file *os.File) (io.Reader, error) {
|
||||||
|
var err error
|
||||||
|
if !*SilentMode {
|
||||||
cmd := exec.Command(GetEditor(), file.Name())
|
cmd := exec.Command(GetEditor(), file.Name())
|
||||||
cmd.Stdin = os.Stdin
|
cmd.Stdin = os.Stdin
|
||||||
cmd.Stdout = os.Stdout
|
cmd.Stdout = os.Stdout
|
||||||
|
|
@ -83,6 +87,7 @@ func GetTextFromFile(file *os.File) (io.Reader, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
_, err = file.Seek(0, 0)
|
_, err = file.Seek(0, 0)
|
||||||
|
}
|
||||||
return file, err
|
return file, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -108,6 +113,7 @@ func IssueFromReader(f io.Reader, editMeta *jkl.EditMeta) *jkl.JiraIssue {
|
||||||
riss := reflect.ValueOf(iss).Elem()
|
riss := reflect.ValueOf(iss).Elem()
|
||||||
fieldsField := riss.FieldByName("Fields").Elem()
|
fieldsField := riss.FieldByName("Fields").Elem()
|
||||||
currentField := reflect.Value{}
|
currentField := reflect.Value{}
|
||||||
|
currFieldName := ""
|
||||||
brd := bufio.NewReader(f)
|
brd := bufio.NewReader(f)
|
||||||
for {
|
for {
|
||||||
b, _, err := brd.ReadLine()
|
b, _, err := brd.ReadLine()
|
||||||
|
|
@ -131,6 +137,7 @@ func IssueFromReader(f io.Reader, editMeta *jkl.EditMeta) *jkl.JiraIssue {
|
||||||
if len(parts) > 0 {
|
if len(parts) > 0 {
|
||||||
iss.Fields.IssueType = &jkl.IssueType{}
|
iss.Fields.IssueType = &jkl.IssueType{}
|
||||||
currentField = reflect.Value{}
|
currentField = reflect.Value{}
|
||||||
|
currFieldName = potentialField
|
||||||
f2 := newfield.Elem()
|
f2 := newfield.Elem()
|
||||||
f3 := f2.FieldByName("Name")
|
f3 := f2.FieldByName("Name")
|
||||||
f3.SetString(strings.TrimSpace(strings.Join(parts, ":")))
|
f3.SetString(strings.TrimSpace(strings.Join(parts, ":")))
|
||||||
|
|
@ -139,6 +146,7 @@ func IssueFromReader(f io.Reader, editMeta *jkl.EditMeta) *jkl.JiraIssue {
|
||||||
if len(parts) > 0 {
|
if len(parts) > 0 {
|
||||||
iss.Fields.Project = &jkl.Project{}
|
iss.Fields.Project = &jkl.Project{}
|
||||||
currentField = reflect.Value{}
|
currentField = reflect.Value{}
|
||||||
|
currFieldName = potentialField
|
||||||
f2 := newfield.Elem()
|
f2 := newfield.Elem()
|
||||||
f3 := f2.FieldByName("Key")
|
f3 := f2.FieldByName("Key")
|
||||||
f3.SetString(strings.TrimSpace(strings.Join(parts, ":")))
|
f3.SetString(strings.TrimSpace(strings.Join(parts, ":")))
|
||||||
|
|
@ -147,11 +155,13 @@ func IssueFromReader(f io.Reader, editMeta *jkl.EditMeta) *jkl.JiraIssue {
|
||||||
if len(parts) > 0 {
|
if len(parts) > 0 {
|
||||||
iss.Fields.Parent = &jkl.JiraIssue{}
|
iss.Fields.Parent = &jkl.JiraIssue{}
|
||||||
currentField = reflect.Value{}
|
currentField = reflect.Value{}
|
||||||
|
currFieldName = potentialField
|
||||||
f2 := newfield.Elem()
|
f2 := newfield.Elem()
|
||||||
f3 := f2.FieldByName("Key")
|
f3 := f2.FieldByName("Key")
|
||||||
f3.SetString(strings.TrimSpace(strings.Join(parts, ":")))
|
f3.SetString(strings.TrimSpace(strings.Join(parts, ":")))
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
currFieldName = potentialField
|
||||||
currentField = newfield
|
currentField = newfield
|
||||||
}
|
}
|
||||||
} else if editMeta != nil {
|
} else if editMeta != nil {
|
||||||
|
|
@ -159,7 +169,13 @@ func IssueFromReader(f io.Reader, editMeta *jkl.EditMeta) *jkl.JiraIssue {
|
||||||
|
|
||||||
}
|
}
|
||||||
if currentField.IsValid() {
|
if currentField.IsValid() {
|
||||||
currentField.SetString(strings.TrimSpace(currentField.String() + "\n" + strings.Join(parts, ":")))
|
newString := currentField.String() + "\n" + strings.Join(parts, ":")
|
||||||
|
if currFieldName != "Description" {
|
||||||
|
newString = strings.TrimSpace(newString)
|
||||||
|
} else if currentField.String() == "" {
|
||||||
|
newString = strings.TrimLeftFunc(newString, unicode.IsSpace)
|
||||||
|
}
|
||||||
|
currentField.SetString(newString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return iss
|
return iss
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@ hell
|
||||||
Issue Type: Sometype
|
Issue Type: Sometype
|
||||||
this is ignored
|
this is ignored
|
||||||
Summary: Dookienator
|
Summary: Dookienator
|
||||||
also ignored`, "\n"))
|
also ignored`, "\n"), nil)
|
||||||
|
|
||||||
AssertEqual(t, `Cowboys
|
AssertEqual(t, `Cowboys
|
||||||
from
|
from
|
||||||
hell`, iss.Fields.Description)
|
hell`, iss.Fields.Description)
|
||||||
|
|
@ -34,3 +35,13 @@ Actual: %v`, expected, actual)
|
||||||
func Assert(t *testing.T, fn func() bool) {
|
func Assert(t *testing.T, fn func() bool) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestIssueFromFile(t *testing.T) {
|
||||||
|
*SilentMode = true
|
||||||
|
issue, err := GetIssueFromFile("editor_test_file.issue", nil, nil)
|
||||||
|
if err != nil {
|
||||||
|
t.Errorf("Apparently we effed up some! --> %v", err)
|
||||||
|
}
|
||||||
|
AssertEqual(t, "Dookie", issue.Fields.Summary)
|
||||||
|
AssertEqual(t, "McDoogal", issue.Fields.Description)
|
||||||
|
}
|
||||||
|
|
|
||||||
2
cmd/jkl/editor_test_file.issue
Normal file
2
cmd/jkl/editor_test_file.issue
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
Summary: Dookie
|
||||||
|
Description: McDoogal
|
||||||
|
|
@ -14,6 +14,7 @@ import (
|
||||||
|
|
||||||
var verbose = flag.Bool("v", false, "Output debug information about jkl")
|
var verbose = flag.Bool("v", false, "Output debug information about jkl")
|
||||||
var help = flag.Bool("h", false, "Outputs usage information message")
|
var help = flag.Bool("h", false, "Outputs usage information message")
|
||||||
|
var SilentMode = flag.Bool("s", false, "Silent execution.")
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
jkl.FindRCFile()
|
jkl.FindRCFile()
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@ func (l *listissue) Color() string {
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
func (l *listissue) EFByName(name string) string {
|
||||||
|
return (*jkl.JiraIssue)(l).EFByName(name)
|
||||||
|
}
|
||||||
|
|
||||||
type ListCmd struct {
|
type ListCmd struct {
|
||||||
args []string
|
args []string
|
||||||
|
|
@ -76,7 +79,7 @@ func (l *ListCmd) List() error {
|
||||||
if issues, err := jkl.List(strings.Join(l.args, " ")); err != nil {
|
if issues, err := jkl.List(strings.Join(l.args, " ")); err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
for _, issue := range issues {
|
for issue := range issues {
|
||||||
var li listissue
|
var li listissue
|
||||||
li = listissue(*issue)
|
li = listissue(*issue)
|
||||||
err := l.tmpl.Execute(os.Stdout, &li)
|
err := l.tmpl.Execute(os.Stdout, &li)
|
||||||
|
|
|
||||||
51
issue.go
51
issue.go
|
|
@ -16,6 +16,8 @@ import (
|
||||||
|
|
||||||
type Search struct {
|
type Search struct {
|
||||||
Issues []*JiraIssue `json:"issues"`
|
Issues []*JiraIssue `json:"issues"`
|
||||||
|
Total int
|
||||||
|
MaxResults int
|
||||||
}
|
}
|
||||||
|
|
||||||
type IssueType struct {
|
type IssueType struct {
|
||||||
|
|
@ -58,10 +60,8 @@ type FieldSpec struct {
|
||||||
}
|
}
|
||||||
Operations []string
|
Operations []string
|
||||||
AllowedValues []*AllowedValue
|
AllowedValues []*AllowedValue
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type CreateMeta struct {
|
type CreateMeta struct {
|
||||||
Projects []*Project
|
Projects []*Project
|
||||||
}
|
}
|
||||||
|
|
@ -168,7 +168,9 @@ func (f *Fields) UnmarshalJSON(b []byte) error{
|
||||||
fmt.Fprintln(os.Stderr, objType, obj, string(mess))
|
fmt.Fprintln(os.Stderr, objType, obj, string(mess))
|
||||||
fmt.Fprintln(os.Stderr, errors.New(fmt.Sprintf("%s [%s]: %s", "Error allocating field", key, err)))
|
fmt.Fprintln(os.Stderr, errors.New(fmt.Sprintf("%s [%s]: %s", "Error allocating field", key, err)))
|
||||||
}
|
}
|
||||||
|
if obj != nil && !(reflect.ValueOf(obj) == reflect.Zero(reflect.TypeOf(obj))) {
|
||||||
field.Set(reflect.ValueOf(obj).Elem())
|
field.Set(reflect.ValueOf(obj).Elem())
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
f.rawExtraFields[key] = mess
|
f.rawExtraFields[key] = mess
|
||||||
}
|
}
|
||||||
|
|
@ -223,20 +225,16 @@ type Transition struct{
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type Schema struct {
|
type Schema struct {
|
||||||
System string
|
System string
|
||||||
Custom string
|
Custom string
|
||||||
CustomId int
|
CustomId int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
type EditMeta struct {
|
type EditMeta struct {
|
||||||
Fields map[string]*FieldSpec
|
Fields map[string]*FieldSpec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
type JiraIssue struct {
|
type JiraIssue struct {
|
||||||
Key string `json:"key,omitempty"`
|
Key string `json:"key,omitempty"`
|
||||||
Fields *Fields `json:"fields,omitempty"`
|
Fields *Fields `json:"fields,omitempty"`
|
||||||
|
|
@ -244,8 +242,8 @@ type JiraIssue struct {
|
||||||
EditMeta *EditMeta `json:"editmeta,omitempty"`
|
EditMeta *EditMeta `json:"editmeta,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var sprintRegexp = regexp.MustCompile(`name=([^,]+),`)
|
var sprintRegexp = regexp.MustCompile(`name=([^,]+),`)
|
||||||
|
|
||||||
func (i *JiraIssue) UnmarshalJSON(b []byte) error {
|
func (i *JiraIssue) UnmarshalJSON(b []byte) error {
|
||||||
tmp := map[string]json.RawMessage{}
|
tmp := map[string]json.RawMessage{}
|
||||||
if len(b) == 0 {
|
if len(b) == 0 {
|
||||||
|
|
@ -282,7 +280,8 @@ func (i *JiraIssue) UnmarshalJSON(b []byte) error {
|
||||||
if len(results) == 2 {
|
if len(results) == 2 {
|
||||||
i.Fields.ExtraFields[k] = results[1]
|
i.Fields.ExtraFields[k] = results[1]
|
||||||
}
|
}
|
||||||
} else {switch f.Schema.Type {
|
} else {
|
||||||
|
switch f.Schema.Type {
|
||||||
case "user":
|
case "user":
|
||||||
a := &Author{}
|
a := &Author{}
|
||||||
json.Unmarshal(v, &a)
|
json.Unmarshal(v, &a)
|
||||||
|
|
@ -290,13 +289,17 @@ func (i *JiraIssue) UnmarshalJSON(b []byte) error {
|
||||||
case "option":
|
case "option":
|
||||||
val := &AllowedValue{}
|
val := &AllowedValue{}
|
||||||
err = json.Unmarshal(v, &val)
|
err = json.Unmarshal(v, &val)
|
||||||
if err != nil {panic(err)}
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
i.Fields.ExtraFields[k] = val
|
i.Fields.ExtraFields[k] = val
|
||||||
case "array":
|
case "array":
|
||||||
if f.Schema.Items == "option" {
|
if f.Schema.Items == "option" {
|
||||||
val := []*AllowedValue{}
|
val := []*AllowedValue{}
|
||||||
err = json.Unmarshal(v, &val)
|
err = json.Unmarshal(v, &val)
|
||||||
if err != nil {panic(err)}
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
i.Fields.ExtraFields[k] = val
|
i.Fields.ExtraFields[k] = val
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
@ -331,6 +334,20 @@ func (i *JiraIssue) String() string {
|
||||||
return b.String()
|
return b.String()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (i *JiraIssue) EFByName(name string) string {
|
||||||
|
for k, f := range i.EditMeta.Fields {
|
||||||
|
if f.Name == name {
|
||||||
|
return fmt.Sprint(i.Fields.ExtraFields[k])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (i *JiraIssue) StoryPoints() string {
|
||||||
|
return i.EFByName("Story Points")
|
||||||
|
}
|
||||||
|
|
||||||
func (i *JiraIssue) PrintExtraFields() string {
|
func (i *JiraIssue) PrintExtraFields() string {
|
||||||
sorter := map[string]string{}
|
sorter := map[string]string{}
|
||||||
b := bytes.NewBuffer(nil)
|
b := bytes.NewBuffer(nil)
|
||||||
|
|
@ -383,5 +400,15 @@ var issueTmplNoColorTxt = "{{.Key}}\t{{if .Fields.IssueType}}[{{.Fields.IssueTyp
|
||||||
"Worklog:\n{{range .Fields.Worklog.Worklogs}}\t{{.}}\n{{end}}"
|
"Worklog:\n{{range .Fields.Worklog.Worklogs}}\t{{.}}\n{{end}}"
|
||||||
|
|
||||||
var CommentIdSeparator = "~"
|
var CommentIdSeparator = "~"
|
||||||
var issueTmpl = template.Must(template.New("issueTmpl").Parse(issueTmplTxt))
|
var issueTmpl, issueTmplNoColor *template.Template
|
||||||
var issueTmplNoColor = template.Must(template.New("issueTmplNoColor").Parse(issueTmplNoColorTxt))
|
|
||||||
|
func SetupTmpl() {
|
||||||
|
isstmpl := os.Getenv("JKL_ISSUE_TMPL")
|
||||||
|
if isstmpl != "" {
|
||||||
|
issueTmpl = template.Must(template.New("issueTmpl").Parse(isstmpl))
|
||||||
|
issueTmplNoColor = issueTmpl
|
||||||
|
} else {
|
||||||
|
issueTmpl = template.Must(template.New("issueTmpl").Parse(issueTmplTxt))
|
||||||
|
issueTmplNoColor = template.Must(template.New("issueTmplNoColor").Parse(issueTmplNoColorTxt))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
1
jkl.go
1
jkl.go
|
|
@ -239,6 +239,7 @@ func DoTransition(taskKey string, transitionName string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func LogWork(taskKey string, workAmount string) error {
|
func LogWork(taskKey string, workAmount string) error {
|
||||||
|
bootHttpClient()
|
||||||
payload, err := serializePayload(map[string]interface{}{"timeSpent": workAmount})
|
payload, err := serializePayload(map[string]interface{}{"timeSpent": workAmount})
|
||||||
resp, err := httpClient.Post("api/2/issue/"+taskKey+"/worklog", payload)
|
resp, err := httpClient.Post("api/2/issue/"+taskKey+"/worklog", payload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue