// resourceIssueLinkCreate creates a new jira issue using the jira api
resourceIssueLinkCreate creates a new jira issue using the jira api
// resourceIssueLinkCreate creates a new jira issue using the jira api
func resourceIssueLinkCreate(d *schema.ResourceData, m interface{}) error {
	config := m.(*Config)
	issueLink := new(jira.IssueLink)
	issueLink.InwardIssue = &jira.Issue{Key: d.Get("inward_key").(string)}
	issueLink.OutwardIssue = &jira.Issue{Key: d.Get("outward_key").(string)}
	issueLink.Type = jira.IssueLinkType{ID: d.Get("link_type").(string)}
	resp, err := config.jiraClient.Issue.AddLink(issueLink)
	if err != nil {
		return errors.Wrap(err, "Creating Issue Link failed")
	}
	location, err := resp.Location()
	if err != nil {
		return errors.Wrap(err, "Creating Issue Link failed")
	}
	components := strings.Split(location.Path, "/")
	ID := components[len(components)-1]
	d.SetId(ID)
	return resourceIssueLinkRead(d, m)
}
func resourceIssueLinkCreate ( d * schema . ResourceData , m interface { } ) error { config := m . ( * Config ) issueLink := new ( jira . IssueLink ) issueLink . InwardIssue = & jira . Issue { Key : d . Get ( " " ) . ( string ) } issueLink . OutwardIssue = & jira . Issue { Key : d . Get ( " " ) . ( string ) } issueLink . Type = jira . IssueLinkType { ID : d . Get ( " " ) . ( string ) } resp , err := config . jiraClient . Issue . AddLink ( issueLink ) if err != nil { return errors . Wrap ( err , " " ) } location , err := resp . Location ( ) if err != nil { return errors . Wrap ( err , " " ) } components := strings . Split ( location . Path , " " ) ID := components [ len ( components ) - 1 ] d . SetId ( ID ) return resourceIssueLinkRead ( d , m ) }
resourceIssueLinkCreate creates a new jira issue using the jira api
resourceIssueLinkCreate creates a new jira issue using the jira api